Esempio n. 1
0
 public function beforeValidate()
 {
     $this->name = $this->BrandName . ' ' . $this->ModelName;
     return parent::beforeValidate();
 }
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 public function beforeValidate()
 {
     if (!empty($this->city_name)) {
         $city = City::find()->where(['name' => $this->city_name])->one();
         if (!empty($city)) {
             $this->city_id = $city->id;
         }
     }
     return parent::beforeValidate();
 }