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


PHP DB_DataObject::update方法代码示例

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


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

示例1: updateDetailed

 function updateDetailed($insertInSolr = true)
 {
     if ($this->updateStarted) {
         return true;
     }
     $this->updateStarted = true;
     global $logger;
     $result = parent::update();
     if (!$insertInSolr) {
         $logger->log("updateDetailed, not inserting in solr because insertInSolr was false", PEAR_LOG_DEBUG);
         $this->updateStarted = false;
         return $result == 1;
     } else {
         if ($result !== FALSE) {
             $logger->log("Updating Solr", PEAR_LOG_DEBUG);
             if (!$this->saveToSolr()) {
                 $logger->log("Could not update Solr", PEAR_LOG_ERR);
                 //Could not save to solr
                 $this->updateStarted = false;
                 return false;
             }
         } else {
             $logger->log("Saving to database failed, not updating solr", PEAR_LOG_ERR);
             $this->updateStarted = false;
             return false;
         }
         $this->updateStarted = false;
         return true;
     }
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:30,代码来源:SolrDataObject.php

示例2: update

 function update($dataObject = false)
 {
     parent::update($dataObject);
     global $interface;
     if (isset($interface)) {
         $interface->assign('session', $this->session_id . ', remember me ' . $this->remember_me);
     }
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:8,代码来源:Session.php

示例3: update

 function update()
 {
     $ret = parent::update();
     //Load the person this is for, and update solr
     if ($this->personId) {
         require_once ROOT_DIR . '/sys/Genealogy/Person.php';
         $person = Person::staticGet('personId', $this->personId);
         $person->saveToSolr();
     }
     return $ret;
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:11,代码来源:Marriage.php

示例4: update

 function update($orig = null)
 {
     if (is_object($orig) && $orig instanceof Memcached_DataObject) {
         $orig->decache();
         # might be different keys
     }
     $result = parent::update($orig);
     if ($result) {
         $this->encache();
     }
     return $result;
 }
开发者ID:Br3nda,项目名称:laconica,代码行数:12,代码来源:Memcached_DataObject.php

示例5: update

 /**
  * Override the update functionality to save the hours
  *
  * @see DB/DB_DataObject::update()
  */
 public function update()
 {
     $ret = parent::update();
     if ($ret !== FALSE) {
         $this->saveHours();
         $this->saveFacets();
     }
     return $ret;
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:14,代码来源:Location.php

示例6: update

 function update()
 {
     $this->calcIpRange();
     return parent::update();
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:5,代码来源:subnet.php

示例7: update

 /**
  * A method for updating the data stored in the database for a given
  * DB_DataObject. Extends the {@link DB_DataObject::update()} method
  * to include auditing of the changes, if required.
  *
  * @see DB_DataObject::update()
  *
  * @access public
  * @param mixed $dataObject An optional parameter. Either a DB_DataObject
  *                          object that should be used for the update, or
  *                          the constant DB_DATAOBJECT_WHEREADD_ONLY, in
  *                          which case the current object's whereAdd()
  *                          method call value will be used to idenfity
  *                          one or more rows which will *all* be updated.
  * @return boolean True on update success, false otherwise.
  */
 function update($dataObject = false)
 {
     // Is this update for a single DB_DataObject, or potentially
     // more than one record?
     if ($dataObject == DB_DATAOBJECT_WHEREADD_ONLY) {
         $aDB_DataObjects = array();
         if ($this->_auditEnabled()) {
             // Prepare a new DB_DataObject to obtain all rows
             // that will be affected
             $doAffected = OA_Dal::factoryDO($this->_tableName);
             $doAffected->_query['condition'] = $this->_query['condition'];
             // Generate an array of all DB_DataObjects that will
             // be udpated
             $doAffected->find();
             while ($doAffected->fetch()) {
                 $aDB_DataObjects[] = $doAffected->_cloneObjectFromDatabase();
             }
         }
         // Update ALL of the required records
         $result = parent::update($dataObject);
         if ($result) {
             // If required, log the changes in the audit trail
             foreach ($aDB_DataObjects as $doAffected) {
                 // Re-clone the object from the database to obtain
                 // what is now the updated DB_DataObject
                 $doUpdated = $doAffected->_cloneObjectFromDatabase();
                 $doUpdated->audit(2, $doAffected);
             }
         }
         return $result;
     }
     // Obtain a copy of the original DB_DataObject from the
     // database before updating the data
     $doOriginal = $this->_cloneObjectFromDatabase();
     // Update the "updated" field of this object
     $this->_refreshUpdated();
     // Update!
     $result = parent::update($dataObject);
     if ($result) {
         // If required, log the change in the audit trail
         $this->audit(2, $doOriginal);
     }
     return $result;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:60,代码来源:DB_DataObjectCommon.php

示例8: update

 /**
  * Override the update functionality to save related objects
  *
  * @see DB/DB_DataObject::update()
  */
 public function update()
 {
     if (isset($this->showInMainDetails) && is_array($this->showInMainDetails)) {
         // convert array to string before storing in database
         $this->showInMainDetails = serialize($this->showInMainDetails);
     }
     $ret = parent::update();
     if ($ret !== FALSE) {
         $this->saveHolidays();
         $this->saveNearbyBookStores();
         $this->saveFacets();
         $this->saveSearchSources();
         $this->saveLibraryLinks();
         $this->saveLibraryTopLinks();
         $this->saveBrowseCategories();
         $this->saveMoreDetailsOptions();
     }
     return $ret;
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:24,代码来源:Library.php

示例9: update

 /**
  * Override the update functionality to save the associated lists
  *
  * @see DB/DB_DataObject::update()
  */
 public function update()
 {
     $ret = parent::update();
     if ($ret === FALSE) {
         return $ret;
     } else {
         $this->saveLists();
     }
     return true;
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:15,代码来源:ListWidget.php

示例10: update

 /**
  * Override the update functionality to save the hours
  *
  * @see DB/DB_DataObject::update()
  */
 public function update()
 {
     $ret = parent::update();
     if ($ret !== FALSE) {
         $this->saveHours();
         $this->saveFacets();
         $this->saveBrowseCategories();
         $this->saveMoreDetailsOptions();
     }
     return $ret;
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:16,代码来源:Location.php

示例11: update

 /**
  * Override the update functionality to save related objects
  *
  * @see DB/DB_DataObject::update()
  */
 public function update()
 {
     $ret = parent::update();
     if ($ret !== FALSE) {
         $this->saveSubBrowseCategories();
     }
     return $ret;
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:13,代码来源:BrowseCategory.php

示例12: delete

 function delete()
 {
     $this->deleted = 1;
     $this->dateUpdated = time();
     parent::update();
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:6,代码来源:UserList.php

示例13: update

 function update($dataObject = false)
 {
     parent::update($dataObject);
     global $memCache;
     $memCache->delete('loan_rule_determiners');
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:6,代码来源:LoanRuleDeterminer.php

示例14: update

 public function update($dataObject = false)
 {
     // avoid those annoying PEAR::DB strict standards warnings it causes
     $old = error_reporting();
     error_reporting(error_reporting() & ~E_STRICT);
     $res = parent::update($dataObject);
     // reset
     error_reporting($old);
     return $res;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:10,代码来源:GS_DataObject.php

示例15: update

 function update()
 {
     $ret = parent::update();
     return $ret;
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:5,代码来源:EditorialReview.php


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