本文整理汇总了PHP中Entity::persist方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::persist方法的具体用法?PHP Entity::persist怎么用?PHP Entity::persist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::persist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: persist
public function persist()
{
if ($this->_ormPersist) {
return parent::persist();
}
if ($this->shouldAudit()) {
$sql = $this->toSQL();
AuditLog::appendSql($sql);
}
}
示例2: addEntity
public static function addEntity($title, $description, $type, $tags, $status, $level, $rating, $special)
{
$id = Entity::$nxtEntity++;
$commentList = "";
$nxtSeqNo = 1;
$created = time();
$updated = $created;
$entityObj = new Entity($id, $title, $description, $type, $commentList, $tags, $nxtSeqNo, $created, $updated, $status, $level, $rating, $special);
$entityObj->persist();
return $entityObj;
}
示例3: persist
public function persist()
{
if (!strlen($this->ip_address) > 0 && isset($_SERVER['REMOTE_ADDR'])) {
$this->ip_address = $_SERVER['REMOTE_ADDR'];
}
if (!$this->userId) {
$audit->userId = Registry::get('user_id');
}
if (self::$_synchronousAudits || $this->_ormPersist) {
return parent::persist();
}
if ($this->shouldAudit()) {
$sql = $this->toSQL();
AuditLog::appendSql($sql);
}
}