Example #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->className() == Album::className()) {
         $this->visible = 1;
     }
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->isNewRecord && $this->className() == Trip::className()) {
         $this->type = 2;
         $this->vehicle = 2;
     }
 }
Example #3
0
 public function init()
 {
     parent::init();
     if ($this->isNewRecord && $this->className() == 'yeesoft\\seo\\models\\Seo') {
         $this->index = 1;
         $this->follow = 1;
     }
 }
Example #4
0
 /**
  * @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']);
 }
Example #5
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->visible = 1;
 }