Ejemplo n.º 1
0
 /**
  * @return \Application\Model\Bean\ProductLog
  */
 private function newLog(Product $product, $eventType)
 {
     $now = \Zend_Date::now();
     $log = ProductLogFactory::createFromArray(array('id_product' => $product->getIdProduct(), 'id_user' => $this->getUser()->getBean()->getIdUser(), 'date_log' => $now->get('yyyy-MM-dd HH:mm:ss'), 'event_type' => $eventType, 'note' => ''));
     $this->getCatalog('ProductLogCatalog')->create($log);
     return $log;
 }
Ejemplo n.º 2
0
 /**
  * @return \Application\Model\Bean\ProductCostLog
  */
 private function newProductCostLog(Product $product)
 {
     $lastProduct = ProductQuery::create()->findByPKOrThrow($product->getIdProduct(), $this->i18n->_("The Product with id {$product->getIdProduct()} does not exist"));
     $now = \Zend_Date::now();
     $log = ProductCostLogFactory::createFromArray(array('id_product' => $product->getIdProduct(), 'id_user' => $this->getUser()->getBean()->getIdUser(), 'date' => $now->get('yyyy-MM-dd HH:mm:ss'), 'price_from' => $lastProduct->getCost(), 'id_currency_from' => $lastProduct->getIdCurrency(), 'price_to' => $product->getCost(), 'id_currency_to' => $product->getIdCurrency()));
     $this->getCatalog('ProductCostLogCatalog')->create($log);
     return $log;
 }