Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 protected function _init()
 {
     $configManager = new Library_Helper_Config();
     $config = $configManager->getConfig(__CLASS__);
     $frontendOptions = $config->toArray();
     $backendOptions = array('rediska' => new Rediska());
     $this->_provider = Zend_Cache::factory('Core', 'Rediska_Zend_Cache_Backend_Redis', $frontendOptions, $backendOptions, false, true);
 }
Ejemplo n.º 2
0
 /**
  * Получить массив звеней цепочки выполнения
  * @return Library_Interface_Currency_Chain_Of_Responsibility[]
  */
 protected function _getChains()
 {
     $configManager = new Library_Helper_Config();
     $config = $configManager->getConfig(__CLASS__);
     $chains = [];
     foreach ($config as $chainName) {
         $chainFullName = __CLASS__ . '_' . $chainName;
         $chains[] = new $chainFullName();
     }
     return $chains;
 }
Ejemplo n.º 3
0
 public function init()
 {
     $configManager = new Library_Helper_Config();
     $config = $configManager->getConfig(__CLASS__);
     $currencies = $config->currencies->toArray();
     $this->setAction('/index/currencyRate')->setMethod('post');
     $firstCurrencyElement = new Zend_Form_Element_Select('firstCurrency');
     $firstCurrencyElement->setAttribs(['options' => $currencies]);
     $this->addElement($firstCurrencyElement);
     $secondCurrencyElement = new Zend_Form_Element_Select('secondCurrency');
     $secondCurrencyElement->setAttribs(['options' => $currencies]);
     $this->addElement($secondCurrencyElement);
 }