本文整理汇总了PHP中BaseActiveRecordVersioned::afterConstruct方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseActiveRecordVersioned::afterConstruct方法的具体用法?PHP BaseActiveRecordVersioned::afterConstruct怎么用?PHP BaseActiveRecordVersioned::afterConstruct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseActiveRecordVersioned
的用法示例。
在下文中一共展示了BaseActiveRecordVersioned::afterConstruct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterConstruct
/**
* set a default display order for a new record.
*/
protected function afterConstruct()
{
parent::afterConstruct();
if (!$this->display_order) {
$criteria = new CDbCriteria();
$criteria->order = 'display_order desc';
$criteria->limit = 1;
$model = get_class($this);
$bottom = $model::model()->find($criteria);
if ($bottom) {
$this->display_order = $bottom->display_order + 1;
} else {
$this->display_order = 1;
}
}
}
开发者ID:openeyes,项目名称:openeyes,代码行数:19,代码来源:OphTrOperationbooking_Operation_Session_UnavailableReason.php
示例2: afterConstruct
/**
* Make sure event date is set.
*/
protected function afterConstruct()
{
$this->event_date = date('Y-m-d H:i:s');
parent::afterConstruct();
}
示例3: afterConstruct
/**
* Add relation to OphTrOperationnote_ProcedureListOperationElement if it exists
*/
protected function afterConstruct()
{
$this->addOpNoteElementRelation();
parent::afterConstruct();
}