コード例 #1
0
ファイル: Places.php プロジェクト: BGCX262/zupal-svn-to-git
 /**
  *
  * @param boolean $pReload
  * @return Zupal_Places
  */
 static function getInstance($pReload = FALSE)
 {
     if ($pReload || is_null(self::$_Instance)) {
         // process
         self::$_Instance = new Zupal_Places(Zupal_Domain_Abstract::STUB);
     }
     return self::$_Instance;
 }
コード例 #2
0
 public function editvalidateAction()
 {
     $place = Zupal_Places::getInstance()->get($this->_getParam('place_id'));
     $this->view->place = new Zupal_Places($place);
     $this->view->form = new Zupal_Places_Form($place);
     if ($this->view->form->isValid($this->_getAllParams())) {
         $this->view->form->fields_to_place();
         $this->view->form->get_place()->save();
         $this->_forward('view', NULL, NULL, array('message' => 'Place Upadated', 'id' => $this->view->form->get_place()->identity()));
     } else {
         $this->_forward('edit', NULL, NULL, array('error' => 'Could not save place', 'reload' => 1, 'id' => $this->view->form->get_place()->identity()));
     }
 }