'ID', 'post_id' => 'Post ID', 'published_from' => 'В слайдере с', 'published_to' => 'В слайдере по', 'is_active' => 'активна', ]; } public function getPost() { return $this->hasOne(News::class,['id'=>'post_id']); } /** * {@inheritdoc} * @return TopSliderQuery the active query used by this AR class. */ public static function find() { return new TopSliderQuery(get_called_class()); } public function beforeSave($insert) { $this->published_from = date("Y-m-d H:i:s",strtotime($this->published_from)); $this->published_to = date("Y-m-d H:i:s",strtotime($this->published_to)); return parent::beforeSave($insert); } }