public function createInvoiceRowArrayFromInvoiceRow(Document\Row $row) { $rowArray = array('rowId' => $row->getId(), 'description' => $row->getDescription(), 'code' => $row->getCode(), 'barcode' => $row->getBarCode(), 'name' => $row->getName(), 'price' => $row->getPrice(), 'quantity' => $row->getQuantity(), 'vats' => $this->findAllObjects(Vat::getClass()), 'selectedVat' => $row->getVat(), 'selectedArticle' => $row->getArticle(), 'uoms' => $this->findAllObjects(Uom::getClass()), 'selectedUom' => $row->getUom(), 'amount' => $row->getAmount(), 'warehouses' => $this->getObjectByField(Warehouse::getClass(), array('hidden' => false)), 'selectedWarehouse' => $row->getWarehouse()); if ($row->getDocument() instanceof Document\CreditInvoice) { $rowArray['minCreditQuantity'] = $row->getQuantity(); $rowArray['creditingRowId'] = $row->getCreditingRowId(); } return $rowArray; }