public static function getSupplyItemOfSupplier($supplierId) { $doctrine = self::$servicelocator->get('doctrine'); $suplyForModel = new supplyForModel($doctrine); $doctrine = self::$servicelocator->get('doctrine'); $supliersItemModel = new supplyItemModel($doctrine); $supplyFor = $suplyForModel->findBy(array('suppilerId' => $supplierId)); $arr = array(); foreach ($supplyFor as $item) { $itemSup = $supliersItemModel->findOneBy(array('id' => $item->getSupplierItem())); if ($itemSup) { $arr[] = array('id' => $itemSup->getId(), 'name' => $itemSup->getValue()); } // $itemSup = new SupplierItem(); } return $arr; }
public static function getRawMaterialInfo($id) { $doctrine = self::$servicelocator->get('doctrine'); $menusStoreModel = new supplyItemModel($doctrine); $menusStore = $menusStoreModel->findOneBy(array('id' => $id)); if ($menusStore) { return $menusStore; } return new SupplierItem(); }