本文整理匯總了PHP中Versioned::augmentWrite方法的典型用法代碼示例。如果您正苦於以下問題:PHP Versioned::augmentWrite方法的具體用法?PHP Versioned::augmentWrite怎麽用?PHP Versioned::augmentWrite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Versioned
的用法示例。
在下文中一共展示了Versioned::augmentWrite方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: augmentWrite
/**
* augmentWrite handles the case where we're trying to update the moderation score or spam score and don't want to create a new version
*/
public function augmentWrite(&$manipulation)
{
/* If we want to create a new version, do that now */
if (!$this->owner->Version || self::$generate_new_version) {
self::$generate_new_version = false;
parent::augmentWrite($manipulation);
return;
}
/* Otherwise, we just change the manipulation to save to the versioned table, and rely on onAfterWrite to fix up the staged & live tables */
$class = $this->owner->class;
$versions = $class . '_versions';
$manipulation[$versions] = $manipulation[$class];
unset($manipulation[$class]);
unset($manipulation[$versions]['id']);
$manipulation[$this->owner->class . '_versions']['where'] = "RecordID = {$this->owner->ID} AND Version = {$this->owner->Version}";
}