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; } }
function update($dataObject = false) { parent::update($dataObject); global $interface; if (isset($interface)) { $interface->assign('session', $this->session_id . ', remember me ' . $this->remember_me); } }
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; }
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; }
/** * 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; }
function update() { $this->calcIpRange(); return parent::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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
function delete() { $this->deleted = 1; $this->dateUpdated = time(); parent::update(); }
function update($dataObject = false) { parent::update($dataObject); global $memCache; $memCache->delete('loan_rule_determiners'); }
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; }
function update() { $ret = parent::update(); return $ret; }
/** * Override the update functionality to save related objects * * @see DB/DB_DataObject::update() */ public function update() { $ret = parent::update(); if ($ret === FALSE) { return $ret; } else { $this->saveHolidays(); $this->saveNearbyBookStores(); $this->saveFacets(); $this->saveSearchSources(); return $ret; } }
function update() { parent::update(); $this->saveRoles(); }
function update($orig = null) { if (is_object($orig)) { $orig->decache(); # might be different keys } return parent::update($orig); }
function update() { //Check to see if we are adding copies. //If so, we wil need to process the hold queue after //The tile is saved $currentValue = new EContentRecord(); $currentValue->id = $this->id; $currentValue->find(true); //Don't update solr, rely on the nightly reindex $ret = parent::update(); if ($ret) { $this->clearCachedCover(); if ($currentValue->N == 1 && $currentValue->availableCopies != $this->availableCopies) { require_once ROOT_DIR . '/Drivers/EContentDriver.php'; $eContentDriver = new EContentDriver(); $eContentDriver->processHoldQueue($this->id); } } return $ret; }
function update() { if ($this->reviewStatus == 0) { $this->reviewStatus = 'Not Reviewed'; } if ($this->getAccessType() == 'acs' && ($this->item_type == 'epub' || $this->item_type == 'pdf')) { require_once ROOT_DIR . '/sys/AdobeContentServer.php'; global $configArray; $uploadResults = AdobeContentServer::packageFile($configArray['EContent']['library'] . '/' . $this->filename, $this->recordId, $this->id, $this->acsId, $this->getAvailableCopies()); if ($uploadResults['success']) { $oldAcs = $this->acsId; $this->acsId = $uploadResults['acsId']; $fileUploaded = true; $deleteResults = AdobeContentServer::deleteResource($oldAcs); } else { $fileUploaded = false; } } $ret = parent::update(); if ($ret > 0) { //Make sure to also update the record this is attached to so the full text can be generated if ($this->item_type == 'epub' || $this->item_type == 'pdf') { $record = $this->getRecord(); $record->update(); } } return $ret; }