/** * @return array */ public function attributeLabels() { return parent::attributeLabels() + ['first_name' => 'Имя', 'second_name' => 'Фамилия', 'email' => 'Email', 'country_id' => 'Страна', 'fullName' => 'Полное имя', 'tour.name' => 'Название тура', 'tour.hotel.name' => 'Название отеля', 'tour.hotel.country.name' => 'Название страны']; }
/** * @return array */ public function attributeLabels() { return parent::attributeLabels() + ['name' => 'Название']; }
/** * @param bool $insert * @return bool */ public function beforeSave($insert) { if ($this->scenario === 'update') { $flyAt = $this->getOldAttribute('fly_at'); $this->fly_at = $this->fly_at !== '' ? \Yii::$app->formatter->asTimestamp($this->fly_at) : $flyAt; } else { $this->fly_at = \Yii::$app->formatter->asTimestamp($this->fly_at); } return parent::beforeSave($insert); }