Beispiel #1
0
 protected function afterValidate()
 {
     Yii::log("Review afterValidate start,scenario=[" . $this->getscenario() . "],new record=[" . ($this->isNewRecord ? 'true' : 'false') . "],[" . print_r($this->attributes, true) . "]", "info");
     parent::afterValidate();
     if (!$this->hasErrors()) {
         if ('valid_photo' == $this->getscenario()) {
             // первый afterValidate при негативном отзыве может не пройти т.к. валидация идёт в 2 этапа. Из-за загрузки картинок
             if ('new' == $this->status) {
                 $this->sendEmailNotifyByNewReview();
             }
         }
     }
     Yii::log("Review afterValidate end", "info");
 }