/** * * @param type $options * @param type $backendApplicationId * @param array $appEnvs Tablica instancji na których mają być ustawione limity */ public function __construct($options = null, $backendApplicationId = 0, array $appEnvs = array(), $edit = false) { if (empty($appEnvs)) { $this->_appEnvs = Logic_Ws_Service::getServiceAppEnvs(); } $this->_edit = $edit; parent::__construct($options, $backendApplicationId); }
/** * Zwraca wartości app_env dla usług, które współdzielą dane między różnymi * instancjami. * Przykład: Produkcyjnie aplikacja działa równolegle pod dwiema instancjami: production * i testing. * Konfiguracja znajduje się w application.ini * @return array */ public static function getServiceAppEnvs() { if (false === empty(self::$_appEnvs)) { return self::$_appEnvs; } $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV); self::$_appEnvs = $config->services->limits->appenv->toArray(); if (true === empty(self::$_appEnvs)) { return self::$_appEnvs = array(APPLICATION_ENV); } return self::$_appEnvs; }
public function deletelimitAction() { $request = $this->getRequest(); $id = $this->_helper->IdConvert->hexToStr($request->getParam('id')); $model = new $this->_model(); $logic = new Logic_Ws_Service($model); try { $logic->deleteLimit($id); $this->_helper->messenger()->success(); } catch (Zend_Db_Exception $e) { $this->_helper->messenger()->error($e->getMessage()); } return $this->_helper->redirector('index'); }