/** * @inheritdoc */ public function init() { parent::init(); if ($this->className() == Album::className()) { $this->visible = 1; } }
/** * @inheritdoc */ public function init() { parent::init(); if ($this->isNewRecord && $this->className() == Trip::className()) { $this->type = 2; $this->vehicle = 2; } }
public function init() { parent::init(); if ($this->isNewRecord && $this->className() == 'yeesoft\\seo\\models\\Seo') { $this->index = 1; $this->follow = 1; } }
/** * @inheritdoc */ public function init() { parent::init(); if ($this->isNewRecord && $this->className() == Post::className()) { $this->published_at = time(); } $this->on(self::EVENT_BEFORE_UPDATE, [$this, 'updateRevision']); $this->on(self::EVENT_AFTER_UPDATE, [$this, 'saveTags']); $this->on(self::EVENT_AFTER_INSERT, [$this, 'saveTags']); }
/** * @inheritdoc */ public function init() { parent::init(); $this->visible = 1; }