本文整理汇总了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}";
}