Example #1
0
 private function editorTypeHandle(Article $a)
 {
     if ($a === null) {
         throw new Exceptions\NullPointerException("Argument Event cannot be null");
     }
     try {
         $editor = null;
         if ($this->getUserService() !== null) {
             $id = $this->getMixId($a->getEditor());
             if ($id !== null) {
                 $editor = $this->getUserService()->getUser($id, false);
             }
         }
         $a->setEditor($editor);
         return $a;
     } catch (\Exception $ex) {
         $this->logError($ex->getMessage());
         throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious());
     }
 }
Example #2
0
 /**
  * Top-down method for updating Article. Called by form success handler.
  * @param ArrayHash $values
  */
 public function updateArticle(ArrayHash $values)
 {
     try {
         $a = new Article((array) $values);
         $a->setEditor($this->getUser()->getIdentity());
         $this->articleService->updateArticle($a);
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataSave($values->id, "this", $ex);
     }
     $this->redirect("default");
 }