示例#1
0
 /**
  * @inheritdoc
  */
 public function scenarios()
 {
     // bypass scenarios() implementation in the parent class
     return Model::scenarios();
 }
示例#2
0
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), ['time' => ['class' => TimestampBehavior::className(), 'createdAtAttribute' => 'dateCreate', 'updatedAtAttribute' => 'dateUpdate', 'value' => new Expression('NOW()')]]);
 }
示例#3
0
 public function behaviors()
 {
     $behaviors = ArrayHelper::merge(parent::behaviors(), ['category' => ['class' => CategoryBehavior::className(), 'route' => '/catalog/default/index']]);
     return $behaviors;
 }
示例#4
0
文件: Lang.php 项目: ivphpan/iris
 public function beforeSave($insert)
 {
     if ($this->default) {
         Lang::updateAll(['default' => '0'], ['<>', 'id', $this->id]);
     }
     return parent::beforeSave($insert);
 }
示例#5
0
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), ['Translit' => ['titleAttribute' => 'fullName']]);
 }
示例#6
0
 public function behaviors()
 {
     $behaviors = ArrayHelper::merge(parent::behaviors(), ['category' => ['class' => CategoryBehavior::className()]]);
     return $behaviors;
 }