Example #1
0
 /**
  * 
  * Brings the products from a storage that are used in de VIM
  * @param \Application\Model\Collection\InventoryRotationCollection $inventory
  * @return \Application\Model\Collection\ProductCollection
  */
 private function getProducts($inventory)
 {
     $name = 'products';
     $storageService = $this->getStorageService();
     $products = $storageService->getValue($name);
     if (!$products) {
         $products = ProductQuery::create()->whereAdd(Product::ITEM_CODE, $inventory->getDistinctItemCodes(), BaseQuery::IN)->addAscendingOrderBy(Product::ITEM_CODE)->find();
         $storageService->saveValue($products, $name);
     }
     return $products;
 }