Пример #1
0
 /**
  * Validates the set data attributes against the model rules
  *
  * @return  bool
  **/
 public function validate()
 {
     $valid = parent::validate();
     if ($valid) {
         $results = \Event::trigger('content.onContentBeforeSave', array('com_answers.comment.content', &$this, $this->isNew()));
         foreach ($results as $result) {
             if ($result === false) {
                 $this->addError(Lang::txt('Content failed validation.'));
                 $valid = false;
             }
         }
     }
     return $valid;
 }