/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->attributes)) { $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->createdByAttribute, $this->updatedByAttribute], BaseActiveRecord::EVENT_BEFORE_UPDATE => $this->updatedByAttribute]; } }
/** * @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 InvalidConfigException('Either "attribute" or "value" property must be specified.'); } }