本文整理汇总了PHP中KDatabaseTableDefault::getRow方法的典型用法代码示例。如果您正苦于以下问题:PHP KDatabaseTableDefault::getRow方法的具体用法?PHP KDatabaseTableDefault::getRow怎么用?PHP KDatabaseTableDefault::getRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDatabaseTableDefault
的用法示例。
在下文中一共展示了KDatabaseTableDefault::getRow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _insertRevision
/**
* Insert a new revision
*
* @param array $data Revision data
* @return void
*/
protected function _insertRevision($status)
{
$table = $this->getTable();
// Get the row data
if ($status == KDatabase::STATUS_UPDATED) {
$data = $this->getData(true);
} else {
$data = $this->getData();
}
// Create the new revision
$revision = $this->_table->getRow();
$revision->table = $table->getName();
$revision->row = $this->id;
$revision->status = $status;
$revision->data = (object) $table->filter($data);
// Set the created_on and created_by information based on the creatable
// or modifiable data in the row itself in cascading order
if($this->isCreatable())
{
if(isset($this->created_by) && !empty($this->created_by)) {
$revision->created_by = $this->created_by;
}
if(isset($this->created_on) && ($this->created_on != $table->getDefault('created_on'))) {
$revision->created_on = $this->created_on;
}
}
if ($this->isModifiable())
{
if(isset($this->modified_by) && !empty($this->modified_by)) {
$revision->created_by = $this->modified_by;
}
if(isset($this->modified_on) && ($this->modified_on != $table->getDefault('modified_on'))) {
$revision->created_on = $this->modified_on;
}
}
// Store the revision
$revision->save();
}