Пример #1
0
 public function updateContent($content, $userId)
 {
     $errors = array();
     $content = CMA_Thread::contentFilter($content, $userId);
     if (empty($content)) {
         $errors[] = CMA::__('Content cannot be empty');
     } else {
         if (!$this->saveContent($content)) {
             $errors[] = 'Failed to update the answer.';
         }
     }
     if (!empty($errors)) {
         throw new Exception(serialize($errors));
     } else {
         return $this;
     }
 }