Ejemplo n.º 1
0
 /**
  * Отображение данных
  */
 public function indexAction()
 {
     $quotation = new Application_Model_QuotationMapper();
     $quotationsFetched = $quotation->fetchAll();
     $currency = new Application_Model_CurrencyMapper();
     $currenciesFetched = $currency->fetchAll();
     $currencyArray = [];
     foreach ($currenciesFetched as $currency) {
         $currencyId = $currency->getId();
         $currencyArray[$currencyId] = $currency;
     }
     $quotationArray = [];
     foreach ($quotationsFetched as $quotation) {
         $baseCurrencyId = $quotation->getBaseCurrencyId();
         $quotatedCurrencyId = $quotation->getQuotatedCurrencyId();
         $quotationArray[$baseCurrencyId][$quotatedCurrencyId] = $quotation;
     }
     $this->view->title = 'Курсы валют';
     $this->view->currencies = $currencyArray;
     $this->view->quotations = $quotationArray;
 }