/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->createdAtAttribute, $this->updatedAtAttribute], BaseActiveRecord::EVENT_BEFORE_UPDATE => $this->updatedAtAttribute]; } }
/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_VALIDATE => $this->slugAttribute]; } if ($this->attribute === null && $this->value === null) { throw new BehaviorException('Either "attribute" or "value" property must be specified.'); } }