本文整理汇总了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;
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例6: update
function update()
{
$this->calcIpRange();
return parent::update();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例12: delete
function delete()
{
$this->deleted = 1;
$this->dateUpdated = time();
parent::update();
}
示例13: update
function update($dataObject = false)
{
parent::update($dataObject);
global $memCache;
$memCache->delete('loan_rule_determiners');
}
示例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;
}
示例15: update
function update()
{
$ret = parent::update();
return $ret;
}