当前位置: 首页>>代码示例>>PHP>>正文


PHP oxBase::exists方法代码示例

本文整理汇总了PHP中oxBase::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP oxBase::exists方法的具体用法?PHP oxBase::exists怎么用?PHP oxBase::exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oxBase的用法示例。


在下文中一共展示了oxBase::exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _preAssignObject

 /**
  * issued before saving an object. can modify aData for saving
  *
  * @param oxBase $oShopObject         shop object
  * @param array  $aData               data to prepare
  * @param bool   $blAllowCustomShopId if allow custom shop id
  *
  * @return array
  */
 protected function _preAssignObject($oShopObject, $aData, $blAllowCustomShopId)
 {
     if (!isset($aData['OXSTOCKFLAG'])) {
         if (!$aData['OXID'] || !$oShopObject->exists($aData['OXID'])) {
             // default value is 1 according to eShop admin functionality
             $aData['OXSTOCKFLAG'] = 1;
         }
     }
     $aData = parent::_preAssignObject($oShopObject, $aData, $blAllowCustomShopId);
     return $aData;
 }
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:20,代码来源:oxerptype_article.php

示例2: exists

 /**
  * Checks if user exists in database.
  *
  * @param string $sOXID object ID (default null)
  *
  * @return bool
  */
 public function exists($sOXID = null)
 {
     if (!$sOXID) {
         $sOXID = $this->getId();
     }
     //#5901 if physical record exists return true unconditionally
     if (parent::exists($sOXID)) {
         $this->setId($sOXID);
         return true;
     }
     //additional username check
     //This part is used by not yet saved user object, to detect the case when such username exists in db.
     //Basically it is called when anonymous visitor enters existing username for newsletter subscription
     //see Newsletter::send()
     //TODO: transfer this validation to newsletter part
     $sShopSelect = '';
     if (!$this->_blMallUsers && $this->oxuser__oxrights->value != 'malladmin') {
         $sShopSelect = ' AND oxshopid = "' . $this->getConfig()->getShopId() . '" ';
     }
     // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
     $masterDb = oxDb::getMaster();
     $sSelect = 'SELECT oxid FROM ' . $this->getViewName() . '
                 WHERE ( oxusername = ' . $masterDb->quote($this->oxuser__oxusername->value) . ' ) ';
     $sSelect .= $sShopSelect;
     if ($sOxid = $masterDb->getOne($sSelect)) {
         // update - set oxid
         $this->setId($sOxid);
         return true;
     }
     return false;
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:38,代码来源:User.php


注:本文中的oxBase::exists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。