Exemple #1
0
 public function updateStaticPage(ArrayHash $values)
 {
     $page = new StaticPage();
     $page->fromArray((array) $values);
     $page->setEditor($this->getUser()->getIdentity());
     try {
         $this->staticPageService->updateStaticPage($page);
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataSave($values->id, "this", $ex);
     }
     $this->redirect("default");
 }
 private function editorTypeHandle(StaticPage $sp)
 {
     try {
         $editor = null;
         $id = $this->getMixId($sp->getEditor());
         if ($id !== null) {
             $editor = $this->getUserService()->getUser($id, false);
         }
         $sp->setEditor($editor);
         return $sp;
     } catch (\Exception $ex) {
         $this->logError($ex->getMessage());
         throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious());
     }
 }