Ejemplo n.º 1
0
 public function indexAction()
 {
     $currencies = $this->_service->findExpired();
     foreach ($currencies as $currency) {
         $this->_service->updateRate($currency);
     }
     exit;
 }
Ejemplo n.º 2
0
 /**
  * POST /api/v1/currencies
  * Create a new currency
  *
  * @param Api_Dto_Currency $dto
  * @return Api_Controller_Response_Result
  */
 public function postAction(Api_Dto_Currency $dto)
 {
     $currency = $this->_service->create($dto);
     $meta = $this->_createMeta(1);
     $meta->addParam('rate', $currency->getRate());
     return $this->_createResult([['id' => $currency->getId()]], $meta)->setLocation($this->_getUrl() . $currency->getId());
 }