/** * * @return Ultimatum_Model_Ultplayergrouporderresizes */ public static function getInstance() { if ($pReload || is_null(self::$_Instance)) { // process self::$_Instance = new self(); } return self::$_Instance; }
function resize($pReload = FALSE) { if ($pReload || is_null($this->_resize)) { $params = array('order_id' => $this->identity()); $value = Ultimatum_Model_Ultplayergrouporderresizes::getInstance()->findOne($params); // process $this->_resize = $value; } return $this->_resize; }
/** * */ public function resizeexecuteAction() { if (!$this->_prep()) { $params = array('error' => 'Cannot load game.'); return $this->_forward('index', 'index', NULL, $params); } elseif (!$this->view->player_group) { $params = array('error' => 'Cannot load group'); return $this->_forward('run', NULL, NULL, $params); } $form = new Ultimatum_Form_GroupResize($this->_getParam('player_group')); $new_values = $form->scale($this->_getAllParams()); $order = new Ultimatum_Model_Ultplayergrouporders(); $order->type = 'resize'; $order->player_group = $this->view->player_group->identity(); $order->save(); $resize = Ultimatum_Model_Ultplayergrouporderresizes::getInstance()->get(NULL, $new_values); $resize->order_id = $order->identity(); $resize->save(); $params = array('message' => 'Group resize order given'); $this->_forward('run', NULL, NULL, $params); }