Example #1
0
 public function fillByPost($post)
 {
     $e = new MultiException();
     parent::fillByPost($post);
     $this->title = trim($this->title);
     $this->text = trim($this->text);
     if ('' === $this->title) {
         $e['title'] = new \Exception('Заголовок некорректен');
     }
     if ('' === $this->text) {
         $e['text'] = new \Exception('Текст некорректен');
     }
     if (count($e) > 0) {
         throw $e;
     }
 }