Exemplo n.º 1
0
 public function afterValidate()
 {
     if (empty($this->principal) && empty($this->secondary)) {
         $this->addError('principal', 'Please select at least one diagnosis');
     }
     return parent::afterValidate();
 }
 public function afterValidate()
 {
     if (!empty($this->phrases)) {
         $has_phrases = false;
         foreach ($this->phrases as $phrase) {
             $phrase && ($has_phrases = true);
         }
         if (!$has_phrases) {
             $this->phrases = array();
         }
     }
     if (!$this->match_correspondence && !$this->match_legacy_letters) {
         $this->addError('match_correspondence', 'Please select which type of letters you want to search');
     }
     return parent::afterValidate();
 }