當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。