public function getEntriesToCompleteInfoArray(PurchaseOrderEntryCollection $entries) { $products = ProductQuery::create()->whereAdd(Product::ITEM_CODE, $entries->getProducts())->find(); $arrayEntries = array(); while ($entries->valid()) { $entry = $entries->read(); $product = $products->getByPK($entry->getIdProduct()); $arrayEntries[] = array("line" => $entry->getLine(), "itemCode" => $product->getItemCode(), "description" => $product->getItemName(), "unitPrice" => $entry->getPrice(), "quantity" => $entry->getQuantity(), "currency" => $entry->getCurrency()); } return $arrayEntries; }