本文整理汇总了PHP中oxDb类的典型用法代码示例。如果您正苦于以下问题:PHP oxDb类的具体用法?PHP oxDb怎么用?PHP oxDb使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了oxDb类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addSel
/**
* Adds selection lists to article.
*/
public function addSel()
{
$aAddSel = $this->_getActionIds('oxselectlist.oxid');
$soxId = oxRegistry::getConfig()->getRequestParameter('synchoxid');
// adding
if (oxRegistry::getConfig()->getRequestParameter('all')) {
$sSLViewName = $this->_getViewName('oxselectlist');
$aAddSel = $this->_getAll($this->_addFilter("select {$sSLViewName}.oxid " . $this->_getQuery()));
}
if ($soxId && $soxId != "-1" && is_array($aAddSel)) {
$oDb = oxDb::getDb();
foreach ($aAddSel as $sAdd) {
$oNew = oxNew("oxbase");
$oNew->init("oxobject2selectlist");
$sObjectIdField = 'oxobject2selectlist__oxobjectid';
$sSelectetionIdField = 'oxobject2selectlist__oxselnid';
$sOxSortField = 'oxobject2selectlist__oxsort';
$oNew->{$sObjectIdField} = new oxField($soxId);
$oNew->{$sSelectetionIdField} = new oxField($sAdd);
$sSql = "select max(oxsort) + 1 from oxobject2selectlist where oxobjectid = {$oDb->quote($soxId)} ";
$oNew->{$sOxSortField} = new oxField((int) $oDb->getOne($sSql, false, false));
$oNew->save();
}
}
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:28,代码来源:article_selection_ajax.php
示例2: tearDown
public function tearDown()
{
oxDb::getDb()->execute("delete from oxcategories where oxid like '_test%'");
oxDb::getDb()->execute("delete from oxarticles where oxid like '_test%'");
oxDb::getDb()->execute("delete from oxobject2category where oxobjectid like '_test%'");
oxDb::getDb()->execute("delete from oxseo where oxobjectid like '_test%'");
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:7,代码来源:oxseoTest.php
示例3: PfandArtikelID
/**
* Vergibt eine ArtikelID für den Pfandartikel und schreibt den Pfandpreis in die DB
*/
protected function PfandArtikelID($price)
{
/* $oxLang = oxLang::getInstance(); */
// bis CE 4.8.9
$oxLang = oxRegistry::getLang();
// ab CE 4.9.0
$title = $oxLang->translateString('VTEC_PFAND', 0);
/* $vtec_mwst = oxConfig::getInstance()->getConfigParam('vtec_pfand_mwst'); */
// bis CE 4.8.9
$vtec_mwst = oxRegistry::getConfig()->getConfigParam('vtec_pfand_mwst');
// ab CE 4.9.0
$sSelect = "SELECT oxid FROM oxarticles WHERE oxtitle = '" . $title . "' AND oxprice = '" . $price . "' LIMIT 1";
$qResult = oxDb::getDb(ADODB_FETCH_ASSOC)->getOne($sSelect);
if ($qResult == false || $qResult == null) {
$oArticle = oxNew("oxarticle");
$aLangs = $oxLang->getLanguageIds();
$oArticle->assign(array('oxarticles__active' => 1, 'oxarticles__oxissearch' => 0, 'oxarticles__oxprice' => $price, 'oxarticles__oxpricea' => $price, 'oxarticles__oxpriceb' => $price, 'oxarticels__oxpricec' => $price, 'oxarticles__oxpic1' => 'pfand.jpg', 'oxarticles__oxvat' => $vtec_mwst));
$oArticle->save();
//foreach ($aLangs as $iLang){
for ($i = 0; $i < count($aLangs); $i++) {
$oArticle->setLanguage($i);
$oArticle->assign(array("oxarticles__oxtitle" => $oxLang->translateString('VTEC_PFAND', $i)));
$oArticle->save();
}
$qResult = $oArticle->oxarticles__oxid->value;
}
return $qResult;
}
开发者ID:Themroc,项目名称:VTEC_Pfand,代码行数:31,代码来源:vtec_oxbasket.php
示例4: getTitleById
/**
* Get state title by id
*
* @param integer|string $iStateId
*
* @return string
*/
public function getTitleById($iStateId)
{
$oDb = oxDb::getDb();
$sQ = "SELECT oxtitle FROM " . getViewName("oxstates") . " WHERE oxid = " . $oDb->quote($iStateId);
$sStateTitle = $oDb->getOne($sQ);
return (string) $sStateTitle;
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:14,代码来源:oxstate.php
示例5: setUp
/**
* Setup: Prepare data - create need tables
*/
public function setUp()
{
oePayPalEvents::addOrderPaymentsTable();
oePayPalEvents::addOrderTable();
oxDb::getDb()->execute('TRUNCATE TABLE `oepaypal_order`');
oxDb::getDb()->execute('TRUNCATE TABLE `oepaypal_orderpayments`');
}
开发者ID:Juergen-Busch,项目名称:paypal,代码行数:10,代码来源:oepaypalorderpaymentstatuscalculatorTest.php
示例6: tearDown
/**
* Tear down the fixture.
*
* @return null
*/
protected function tearDown()
{
$this->cleanUpTable('oxuser');
oxDb::getDb()->execute("delete from oxremark where oxparentid = '_testArt'");
oxDb::getDb()->execute("delete from oxnewssubscribed where oxuserid = '_testArt'");
parent::tearDown();
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:12,代码来源:forgotpwdTest.php
示例7: addCatToAttr
/**
* Adds category to Attributes list
*/
public function addCatToAttr()
{
$aAddCategory = $this->_getActionIds('oxcategories.oxid');
$soxId = oxRegistry::getConfig()->getRequestParameter('synchoxid');
$oAttribute = oxNew("oxattribute");
// adding
if (oxRegistry::getConfig()->getRequestParameter('all')) {
$sCatTable = $this->_getViewName('oxcategories');
$aAddCategory = $this->_getAll($this->_addFilter("select {$sCatTable}.oxid " . $this->_getQuery()));
}
if ($oAttribute->load($soxId) && is_array($aAddCategory)) {
$oDb = oxDb::getDb();
foreach ($aAddCategory as $sAdd) {
$oNewGroup = oxNew("oxbase");
$oNewGroup->init("oxcategory2attribute");
$sOxSortField = 'oxcategory2attribute__oxsort';
$sObjectIdField = 'oxcategory2attribute__oxobjectid';
$sAttributeIdField = 'oxcategory2attribute__oxattrid';
$sOxIdField = 'oxattribute__oxid';
$oNewGroup->{$sObjectIdField} = new oxField($sAdd);
$oNewGroup->{$sAttributeIdField} = new oxField($oAttribute->{$sOxIdField}->value);
$sSql = "select max(oxsort) + 1 from oxcategory2attribute where oxobjectid = '{$sAdd}' ";
$oNewGroup->{$sOxSortField} = new oxField((int) $oDb->getOne($sSql, false, false));
$oNewGroup->save();
}
}
$this->resetContentCache();
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:31,代码来源:attribute_category_ajax.php
示例8: onDeactivate
/**
* Is called on module deactivation. Deletes the theme settings. Note that after deactivation the settings
* will be lost.
*/
public static function onDeactivate()
{
$iShopId = oxRegistry::getConfig()->getShopId();
$sThemeName = self::_getThemeName();
$sDeleteSQL = "\n DELETE\n oxconfig.*,\n oxconfigdisplay.*\n FROM `oxconfig`\n LEFT JOIN `oxconfigdisplay`\n ON ( `oxconfig`.`OXID` = `oxconfigdisplay`.`OXID` )\n WHERE `oxconfig`.`OXMODULE` = ? AND `oxconfig`.`oxshopid` = ?\n ";
oxDb::getDb()->Execute($sDeleteSQL, array('theme:' . $sThemeName, $iShopId));
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:11,代码来源:oethemeswitcherevents.php
示例9: setUp
/**
* Set up
*/
protected function setUp()
{
parent::setUp();
// fix for state ID compatability between editions
$sSqlState = "REPLACE INTO `oxstates` (`OXID`, `OXCOUNTRYID`, `OXTITLE`, `OXISOALPHA2`, `OXTITLE_1`, `OXTITLE_2`, `OXTITLE_3`, `OXTIMESTAMP`) " . "VALUES ('333', '8f241f11096877ac0.98748826', 'USA last state', 'SS', 'USA last state', '', '', CURRENT_TIMESTAMP);";
oxDb::getDb()->execute($sSqlState);
}
开发者ID:Juergen-Busch,项目名称:paypal,代码行数:10,代码来源:oepaypalstandarddispatcherTest.php
示例10: render
/**
* Executes parent method parent::render(), creates oxpricealarm object
* and passes it's data to Smarty engine. Returns name of template file
* "pricealarm_main.tpl".
*
* @return string
*/
public function render()
{
$config = $this->getConfig();
parent::render();
$shopId = $config->getShopId();
//articles price in subshop and baseshop can be different
$this->_aViewData['iAllCnt'] = 0;
$query = "\n SELECT oxprice, oxartid\n FROM oxpricealarm\n WHERE oxsended = '000-00-00 00:00:00' AND oxshopid = '{$shopId}' ";
$result = oxDb::getDb()->execute($query);
if ($result != false && $result->recordCount() > 0) {
$simpleCache = array();
while (!$result->EOF) {
$price = $result->fields[0];
$articleId = $result->fields[1];
if (isset($simpleCache[$articleId])) {
if ($simpleCache[$articleId] <= $price) {
$this->_aViewData['iAllCnt'] += 1;
}
} else {
$article = oxNew("oxArticle");
if ($article->load($articleId)) {
$articlePrice = $simpleCache[$articleId] = $article->getPrice()->getBruttoPrice();
if ($articlePrice <= $price) {
$this->_aViewData['iAllCnt'] += 1;
}
}
}
$result->moveNext();
}
}
return "pricealarm_mail.tpl";
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:39,代码来源:pricealarm_mail.php
示例11: getIdByName
/**
* returns delivery set id
*
* @param string $sTitle delivery name
*
* @return string
*/
public function getIdByName($sTitle)
{
$oDb = oxDb::getDb();
$sQ = "SELECT `oxid` FROM `" . getViewName('oxdeliveryset') . "` WHERE `oxtitle` = " . $oDb->quote($sTitle);
$sId = $oDb->getOne($sQ);
return $sId;
}
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:14,代码来源:oxdeliveryset.php
示例12: render
/**
* Executes parent method parent::render(), creates oxuser, oxlist and
* oxRemark objects, passes data to Smarty engine and returns name of
* template file "user_remark.tpl".
*
* @return string
*/
public function render()
{
parent::render();
$soxId = $this->getEditObjectId();
$sRemoxId = oxRegistry::getConfig()->getRequestParameter("rem_oxid");
if ($soxId != "-1" && isset($soxId)) {
// load object
$oUser = oxNew("oxuser");
$oUser->load($soxId);
$this->_aViewData["edit"] = $oUser;
// all remark
$oRems = oxNew("oxlist");
$oRems->init("oxremark");
$sQuotedUserId = oxDb::getDb()->quote($oUser->getId());
$sSelect = "select * from oxremark where oxparentid=" . $sQuotedUserId . " order by oxcreate desc";
$oRems->selectString($sSelect);
foreach ($oRems as $key => $val) {
if ($val->oxremark__oxid->value == $sRemoxId) {
$val->selected = 1;
$oRems[$key] = $val;
break;
}
}
$this->_aViewData["allremark"] = $oRems;
if (isset($sRemoxId)) {
$oRemark = oxNew("oxRemark");
$oRemark->load($sRemoxId);
$this->_aViewData["remarktext"] = $oRemark->oxremark__oxtext->value;
$this->_aViewData["remarkheader"] = $oRemark->oxremark__oxheader->value;
}
}
return "user_remark.tpl";
}
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:40,代码来源:user_remark.php
示例13: getONGRVersionId
/**
* Returns ongr version id.
*
* @return int
*/
public function getONGRVersionId()
{
$oDb = oxDb::getDb();
$sql = 'SELECT ID FROM ongr_sync_jobs WHERE OXID=';
$sql .= $oDb->quote($this->getId()) . ' ORDER BY ID DESC LIMIT 1';
return (int) $oDb->getOne($sql);
}
开发者ID:jkrug,项目名称:OxidSyncModule,代码行数:12,代码来源:ongr_sync_oxarticle.php
示例14: jxGetCategoryList
public function jxGetCategoryList($sParent, $sNoPath, $sCatPath)
{
$myConfig = $this->getConfig();
if (!empty($sNoPath)) {
$sNoPath .= '.';
$sCatPath .= ' / ';
}
$sWhere = "";
if ($myConfig->getConfigParam('sJxGTaxoDisplayInactive') == FALSE) {
$sWhere .= "AND c.oxactive = 1 ";
}
if ($myConfig->getConfigParam('sJxGTaxoDisplayHidden') == FALSE) {
$sWhere .= "AND c.oxhidden = 0 ";
}
$sSql = "SELECT c.oxid, c.oxtitle, c.oxactive, c.oxhidden, " . "(SELECT COUNT(*) FROM oxobject2category o2c WHERE o2c.oxcatnid = c.oxid) AS artcount, " . "(SELECT COUNT(*) FROM oxcategories c1 WHERE c1.oxparentid=c.oxid) AS count, c.jxamazoncategory AS taxonomy " . "FROM oxcategories c " . "WHERE c.oxparentid = '{$sParent}' " . $sWhere . "ORDER BY c.oxtitle";
$oDb = oxDb::getDb(oxDB::FETCH_MODE_ASSOC);
$rs = $oDb->Execute($sSql);
$i = 1;
while (!$rs->EOF) {
$aCols = $rs->fields;
$aCols['path'] = $sNoPath . $i;
$aCols['oxtitle'] = $sCatPath . $aCols['oxtitle'];
array_push($this->aCategories, $aCols);
if ($aCols['count'] != 0) {
$this->jxGetCategoryList($aCols['oxid'], $aCols['path'], $aCols['oxtitle']);
}
$rs->MoveNext();
$i++;
}
return;
}
开发者ID:rkonweh,项目名称:jxTaxo,代码行数:31,代码来源:jxamazoncategory.php
示例15: execute
/**
* Executes the current command.
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
// allow empty password
$dbPwd = \oxRegistry::getConfig()->getConfigParam('dbPwd');
if (!empty($dbPwd)) {
$dbPwd = '-p' . $dbPwd;
}
$file = $input->getOption('file');
if (!empty($file)) {
$file = "> " . $file;
} else {
$file = "";
}
if ($input->getOption('ignoreViews')) {
$dbName = \oxRegistry::getConfig()->getConfigParam('dbName');
$viewsResultArray = \oxDb::getDb()->getArray("SHOW FULL TABLES IN {$dbName} WHERE TABLE_TYPE LIKE 'VIEW'");
$ignoreViewTables = array();
foreach ($viewsResultArray as $viewArray) {
$ignoreViewTables[] = '--ignore-table=' . $dbName . '.' . $viewArray[0];
}
$ignoreViewTables = implode(' ', $ignoreViewTables);
}
$exec = sprintf("mysqldump -h%s %s -u%s %s %s %s 2>&1", \oxRegistry::getConfig()->getConfigParam('dbHost'), $dbPwd, \oxRegistry::getConfig()->getConfigParam('dbUser'), \oxRegistry::getConfig()->getConfigParam('dbName'), $ignoreViewTables, $file);
exec($exec, $commandOutput, $returnValue);
if ($returnValue > 0) {
$output->writeln('<error>' . implode(PHP_EOL, $commandOutput) . '</error>');
return;
}
if (!empty($file)) {
$output->writeln("<info>Dump {$input->getOption('file')} created.</info>");
} else {
$output->writeln($commandOutput);
}
}
开发者ID:marcharding,项目名称:oxrun,代码行数:40,代码来源:DumpCommand.php
示例16: getUserCount
/**
* Returns count of users assigned to active newsletter receiver group
*
* @return int
*/
public function getUserCount()
{
if ($this->_iUserCount === null) {
$this->_iUserCount = 0;
// load object
$oNewsletter = oxNew("oxnewsletter");
if ($oNewsletter->load($this->getEditObjectId())) {
// get nr. of users in these groups
// we do not use lists here as we dont need this overhead right now
$oDB = oxDb::getDb();
$blSep = false;
$sSelectGroups = " ( oxobject2group.oxgroupsid in ( ";
// remove already added groups
foreach ($oNewsletter->getGroups() as $oInGroup) {
if ($blSep) {
$sSelectGroups .= ",";
}
$sSelectGroups .= $oDB->quote($oInGroup->oxgroups__oxid->value);
$blSep = true;
}
$sSelectGroups .= " ) ) ";
// no group selected
if (!$blSep) {
$sSelectGroups = " oxobject2group.oxobjectid is null ";
}
$sShopId = $this->getConfig()->getShopID();
$sQ = "select count(*) from ( select oxnewssubscribed.oxemail as _icnt from oxnewssubscribed left join\n oxobject2group on oxobject2group.oxobjectid = oxnewssubscribed.oxuserid\n where ( oxobject2group.oxshopid = '{$sShopId}'\n or oxobject2group.oxshopid is null ) and {$sSelectGroups} and\n oxnewssubscribed.oxdboptin = 1 and ( not ( oxnewssubscribed.oxemailfailed = '1') )\n and (not(oxnewssubscribed.oxemailfailed = '1')) and oxnewssubscribed.oxshopid = '{$sShopId}'\n group by oxnewssubscribed.oxemail ) as _tmp";
$this->_iUserCount = $oDB->getOne($sQ, false, false);
}
}
return $this->_iUserCount;
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:37,代码来源:newsletter_selection.php
示例17: onDeactivate
/**
* Module deactivation script: executes the sql to delte the opening time snippet.
*/
public static function onDeactivate()
{
$oDb = oxDb::getDb();
$delete_sql = "DELETE FROM `oxcontents` WHERE `OXLOADID` = 'openingHours'";
$oDb->execute($delete_sql);
return true;
}
开发者ID:JulianaSchuster,项目名称:jsNewContact_OXID,代码行数:10,代码来源:jsnewcontacthandledatabase.php
示例18: onActivate
/**
* Setup routine
*/
public static function onActivate()
{
if (class_exists('oxRegistry')) {
$myConfig = oxRegistry::getConfig();
} else {
$myConfig = oxConfig::getInstance()->getConfig();
}
$bIsEE = $myConfig->getEdition() === "EE";
try {
$db = oxDb::getDb();
// create oxjson groups
if ($bIsEE) {
$maxRRId = intval($db->getOne("select MAX(OXRRID) from oxgroups"));
$nextRRId = $maxRRId + 1;
$sQ = "INSERT IGNORE INTO oxgroups (OXID, OXACTIVE, OXTITLE, OXTITLE_1, OXRRID) VALUES ('oxjsonro', '1', 'OXJSON Read-only', 'OXJSON Read-only', '{$nextRRId}');";
$db->Execute($sQ);
$nextRRId++;
$sQ = "INSERT IGNORE INTO oxgroups (OXID, OXACTIVE, OXTITLE, OXTITLE_1, OXRRID) VALUES ('oxjsonfull', '1', 'OXJSON Full', 'OXJSON Full', '{$nextRRId}');";
$db->Execute($sQ);
} else {
$sQ = "INSERT IGNORE INTO oxgroups (OXID, OXACTIVE, OXTITLE, OXTITLE_1) VALUES ('oxjsonro', '1', 'OXJSON Read-only', 'OXJSON Read-only');";
$db->Execute($sQ);
$nextRRId++;
$sQ = "INSERT IGNORE INTO oxgroups (OXID, OXACTIVE, OXTITLE, OXTITLE_1) VALUES ('oxjsonfull', '1', 'OXJSON Full', 'OXJSON Full');";
$db->Execute($sQ);
}
} catch (Exception $ex) {
error_log("Error activating module: " . $ex->getMessage());
}
}
开发者ID:rahsm,项目名称:oxidjson,代码行数:33,代码来源:oxjson_setup.php
示例19: cleanup
public static function cleanup()
{
$oDb = oxDb::getDb();
$sShopId = oxRegistry::getConfig()->getShopId();
$sQuery = "DELETE FROM `oxseo` WHERE `OXSTDURL` LIKE '%StylaSEO_Output%' and oxshopid = " . $oDb->quote($sShopId) . " ;";
$oDb->Execute($sQuery);
}
开发者ID:styladev,项目名称:oxid,代码行数:7,代码来源:StylaSEO_Setup.php
示例20: addpaytoset
/**
* Adds this payments to this set
*
* @return null
*/
public function addpaytoset()
{
$aChosenSets = $this->_getActionIds('oxpayments.oxid');
$soxId = oxConfig::getParameter('synchoxid');
// adding
if (oxConfig::getParameter('all')) {
$sPayTable = $this->_getViewName('oxpayments');
$aChosenSets = $this->_getAll($this->_addFilter("select {$sPayTable}.oxid " . $this->_getQuery()));
}
if ($soxId && $soxId != "-1" && is_array($aChosenSets)) {
$oDb = oxDb::getDb();
foreach ($aChosenSets as $sChosenSet) {
// check if we have this entry already in
$sID = $oDb->GetOne("select oxid from oxobject2payment where oxpaymentid = " . $oDb->quote($sChosenSet) . " and oxobjectid = " . $oDb->quote($soxId) . " and oxtype = 'oxdelset'");
if (!isset($sID) || !$sID) {
$oObject = oxNew('oxbase');
$oObject->init('oxobject2payment');
$oObject->oxobject2payment__oxpaymentid = new oxField($sChosenSet);
$oObject->oxobject2payment__oxobjectid = new oxField($soxId);
$oObject->oxobject2payment__oxtype = new oxField("oxdelset");
$oObject->save();
}
}
}
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:30,代码来源:deliveryset_payment.inc.php
注:本文中的oxDb类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论