本文整理汇总了PHP中CActiveRecord::afterConstruct方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveRecord::afterConstruct方法的具体用法?PHP CActiveRecord::afterConstruct怎么用?PHP CActiveRecord::afterConstruct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveRecord
的用法示例。
在下文中一共展示了CActiveRecord::afterConstruct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterConstruct
protected function afterConstruct()
{
parent::afterConstruct();
$this->initLanguageAttribute('titles');
//behavior method
$this->initLanguageAttribute('descriptions');
//behavior method
}
示例2: afterConstruct
/**
* Callback executed after construction.
*/
public function afterConstruct()
{
parent::afterConstruct();
// Init default quotas
$this->crash_reports_per_group_quota = 100;
$this->crash_report_files_disc_quota = 512;
$this->bug_attachment_files_disc_quota = 100;
$this->debug_info_files_disc_quota = 2048;
}
示例3: afterConstruct
/**
* afterConstruct
* Sets a default project name, timestamp and username
*/
protected function afterConstruct()
{
$this->project = 'Project ' . date(Yii::app()->params['dateFormat']);
$this->username = Yii::app()->user->id;
$this->timestamp = date(Yii::app()->params['dateTimeFormatDB']);
$this->total_water_demand = 0;
$this->effective_water_demand = 0;
$this->status = $this->swGetStatus()->toString();
parent::afterConstruct();
}
示例4: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
$this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
$this->defaultColumns[] = 'district_id';
$this->defaultColumns[] = 'district_name';
$this->defaultColumns[] = 'city';
$this->defaultColumns[] = 'province';
}
parent::afterConstruct();
}
示例5: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
/*
$this->defaultColumns[] = array(
'class' => 'CCheckBoxColumn',
'name' => 'id',
'selectableRows' => 2,
'checkBoxHtmlOptions' => array('name' => 'trash_id[]')
);
*/
$this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
if (!isset($_GET['photo'])) {
$this->defaultColumns[] = array('name' => 'photo_search', 'value' => '$data->photo->media');
}
$this->defaultColumns[] = array('name' => 'tag_search', 'value' => '$data->tag->body');
$this->defaultColumns[] = array('name' => 'creation_search', 'value' => '$data->creation->displayname');
$this->defaultColumns[] = array('name' => 'creation_date', 'value' => 'Utility::dateFormat($data->creation_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'creation_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'creation_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
}
parent::afterConstruct();
}
示例6: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
$this->defaultColumns[] = 'id';
$this->defaultColumns[] = 'meta_image';
$this->defaultColumns[] = 'meta_image_alt';
$this->defaultColumns[] = 'office_on';
$this->defaultColumns[] = 'office_name';
$this->defaultColumns[] = 'office_location';
$this->defaultColumns[] = 'office_place';
$this->defaultColumns[] = 'office_country';
$this->defaultColumns[] = 'office_province';
$this->defaultColumns[] = 'office_city';
$this->defaultColumns[] = 'office_district';
$this->defaultColumns[] = 'office_village';
$this->defaultColumns[] = 'office_zipcode';
$this->defaultColumns[] = 'office_hour';
$this->defaultColumns[] = 'office_phone';
$this->defaultColumns[] = 'office_fax';
$this->defaultColumns[] = 'office_email';
$this->defaultColumns[] = 'office_hotline';
$this->defaultColumns[] = 'office_website';
$this->defaultColumns[] = 'google_on';
$this->defaultColumns[] = 'twitter_on';
$this->defaultColumns[] = 'twitter_card';
$this->defaultColumns[] = 'twitter_site';
$this->defaultColumns[] = 'twitter_creator';
$this->defaultColumns[] = 'twitter_photo_width';
$this->defaultColumns[] = 'twitter_photo_height';
$this->defaultColumns[] = 'twitter_country';
$this->defaultColumns[] = 'twitter_iphone_name';
$this->defaultColumns[] = 'twitter_iphone_id';
$this->defaultColumns[] = 'twitter_iphone_url';
$this->defaultColumns[] = 'twitter_ipad_name';
$this->defaultColumns[] = 'twitter_ipad_id';
$this->defaultColumns[] = 'twitter_ipad_url';
$this->defaultColumns[] = 'twitter_googleplay_name';
$this->defaultColumns[] = 'twitter_googleplay_id';
$this->defaultColumns[] = 'twitter_googleplay_url';
$this->defaultColumns[] = 'facebook_on';
$this->defaultColumns[] = 'facebook_type';
$this->defaultColumns[] = 'facebook_profile_firstname';
$this->defaultColumns[] = 'facebook_profile_lastname';
$this->defaultColumns[] = 'facebook_profile_username';
$this->defaultColumns[] = 'facebook_sitename';
$this->defaultColumns[] = 'facebook_see_also';
$this->defaultColumns[] = 'facebook_admins';
$this->defaultColumns[] = 'modified_date';
$this->defaultColumns[] = array('name' => 'modified_search', 'value' => '$data->modified_relation->displayname');
}
parent::afterConstruct();
}
示例7: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
/*
$this->defaultColumns[] = array(
'class' => 'CCheckBoxColumn',
'name' => 'id',
'selectableRows' => 2,
'checkBoxHtmlOptions' => array('name' => 'trash_id[]')
);
*/
$this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
$this->defaultColumns[] = array('name' => 'user_search', 'value' => '$data->user->displayname');
$this->defaultColumns[] = 'android_id';
$this->defaultColumns[] = array('name' => 'creation_date', 'value' => 'Utility::dateFormat($data->creation_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'creation_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'creation_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
$this->defaultColumns[] = array('name' => 'generate_date', 'value' => 'Utility::dateFormat($data->generate_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'generate_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'generate_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
$this->defaultColumns[] = array('name' => 'unpublish_date', 'value' => 'Utility::dateFormat($data->unpublish_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'unpublish_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'unpublish_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
if (!isset($_GET['type'])) {
$this->defaultColumns[] = array('name' => 'publish', 'value' => 'Utility::getPublish(Yii::app()->controller->createUrl("publish",array("id"=>$data->id)), $data->publish, 1)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
}
}
parent::afterConstruct();
}
示例8: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
$this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
$this->defaultColumns[] = 'folder';
$this->defaultColumns[] = array('name' => 'name', 'value' => '$data->name == "" ? "-" : $data->name');
$this->defaultColumns[] = array('name' => 'desc', 'value' => '$data->desc == "" ? "-" : $data->desc');
$this->defaultColumns[] = array('name' => 'creation_search', 'value' => '$data->creation_relation->displayname');
$this->defaultColumns[] = array('name' => 'creation_date', 'value' => 'Utility::dateFormat($data->creation_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'creation_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'creation_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
$this->defaultColumns[] = array('name' => 'install', 'value' => '$data->install == 1 ? Chtml::image(Yii::app()->theme->baseUrl.\'/images/icons/publish.png\') : Utility::getPublish(Yii::app()->controller->createUrl("install",array("id"=>$data->plugin_id)), $data->install, 10)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
$this->defaultColumns[] = array('name' => 'actived', 'value' => '$data->install == 1 ? ($data->actived == 2 ? Chtml::image(Yii::app()->theme->baseUrl.\'/images/icons/publish.png\') : Utility::getPublish(Yii::app()->controller->createUrl("active",array("id"=>$data->plugin_id)), $data->actived, 2)) : "-"', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
$this->defaultColumns[] = array('name' => 'search', 'value' => '$data->search == 1 ? Chtml::image(Yii::app()->theme->baseUrl.\'/images/icons/publish.png\') : Chtml::image(Yii::app()->theme->baseUrl.\'/images/icons/unpublish.png\')', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
$this->defaultColumns[] = array('name' => 'defaults', 'value' => '$data->install == 1 ? ($data->defaults == 1 ? Chtml::image(Yii::app()->theme->baseUrl.\'/images/icons/publish.png\') : Utility::getPublish(Yii::app()->controller->createUrl("default",array("id"=>$data->plugin_id)), $data->defaults, 6)) : "-"', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
}
parent::afterConstruct();
}
示例9: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
/*
$this->defaultColumns[] = array(
'class' => 'CCheckBoxColumn',
'name' => 'id',
'selectableRows' => 2,
'checkBoxHtmlOptions' => array('name' => 'trash_id[]')
);
*/
$this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
$this->defaultColumns[] = 'menu_id';
$this->defaultColumns[] = 'title';
}
parent::afterConstruct();
}
示例10: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
$this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
$this->defaultColumns[] = array('name' => 'user_search', 'value' => '$data->newsletter->user_id != 0 ? $data->newsletter->user->displayname : "-"');
$this->defaultColumns[] = array('name' => 'email_search', 'value' => '$data->newsletter->email');
$this->defaultColumns[] = array('name' => 'status', 'value' => '$data->status == 1 ? Phrase::trans(23057,1) : Phrase::trans(16256,1)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Phrase::trans(23057, 1), 0 => Phrase::trans(16256, 1)), 'type' => 'raw');
$this->defaultColumns[] = array('name' => 'creation_date', 'value' => 'Utility::dateFormat($data->creation_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'creation_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'creation_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
}
parent::afterConstruct();
}
示例11: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
$this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
//$this->defaultColumns[] = 'cat_id';
$this->defaultColumns[] = 'category_name';
$this->defaultColumns[] = 'category_desc';
$this->defaultColumns[] = 'album_publish';
$this->defaultColumns[] = 'album_unpublish';
$this->defaultColumns[] = 'albums';
}
parent::afterConstruct();
}
示例12: afterConstruct
/**
* afterConstruct
*/
protected function afterConstruct()
{
$this->pe = 0;
$this->water_demand = 0;
parent::afterConstruct();
}
示例13: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
$this->defaultColumns[] = 'level_id';
$this->defaultColumns[] = 'level_name';
$this->defaultColumns[] = 'level_desc';
$this->defaultColumns[] = 'oauths';
}
parent::afterConstruct();
}
示例14: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
$this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
$this->defaultColumns[] = array('name' => 'title', 'value' => 'Phrase::trans($data->name, 2)');
$this->defaultColumns[] = array('name' => 'icons', 'value' => '$data->icons != "" ? CHtml::link($data->icons, Yii::app()->request->baseUrl.\'/public/support/\'.$data->icons, array(\'target\' => \'_blank\')) : "-"', 'type' => 'raw');
$this->defaultColumns[] = array('name' => 'creation_search', 'value' => '$data->creation_relation->displayname');
$this->defaultColumns[] = array('name' => 'creation_date', 'value' => 'Utility::dateFormat($data->creation_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'creation_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'creation_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true));
$this->defaultColumns[] = array('name' => 'publish', 'value' => '$data->publish == 2 ? "-" : Utility::getPublish(Yii::app()->controller->createUrl("publish",array("id"=>$data->cat_id)), $data->publish, 1) ', 'htmlOptions' => array('class' => 'center'), 'type' => 'raw');
}
parent::afterConstruct();
}
示例15: afterConstruct
/**
* Set default columns to display
*/
protected function afterConstruct()
{
if (count($this->defaultColumns) == 0) {
/*
$this->defaultColumns[] = array(
'class' => 'CCheckBoxColumn',
'name' => 'id',
'selectableRows' => 2,
'checkBoxHtmlOptions' => array('name' => 'trash_id[]')
);
*/
$this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1');
$this->defaultColumns[] = array('name' => 'dependency', 'value' => '$data->dependency != 0 ? Phrase::trans(ReportCategory::model()->findByPk($data->dependency)->name, 2) : \'-\'');
$this->defaultColumns[] = array('name' => 'title', 'value' => 'Phrase::trans($data->name, 2)');
$this->defaultColumns[] = array('name' => 'description', 'value' => 'Phrase::trans($data->desc, 2)');
if (!isset($_GET['type'])) {
$this->defaultColumns[] = array('name' => 'publish', 'value' => 'Utility::getPublish(Yii::app()->controller->createUrl("publish",array("id"=>$data->cat_id)), $data->publish, 1)', 'htmlOptions' => array('class' => 'center'), 'type' => 'raw');
}
}
parent::afterConstruct();
}