public function convertToArray($datas, $store = SUB_STORE) { $return = array(); foreach ($datas as $data) { $storeInfo = Utility::getStoreInfo($data->getMenuStoreId()); if ($store == MAIN_STORE) { $storeInfo = Utility::getMainStoreInfo($data->getMenuStoreId()); } $note = TransactionUtility::getStoreItemInOrder($data->getNote()); if ($note == '') { $note = $data->getNote(); } $supplier = Utility::getSupplierInfo($data->getSupplier()); $array = array(); $array['id'] = $data->getId(); $array['menuStoreId'] = $storeInfo->getName(); $array['action'] = $data->getAction(); $array['quantity'] = $data->getQuantity(); $array['unit'] = $data->getUnit(); $array['date'] = date('d-m-Y', $data->getDate()); $array['note'] = $note; $array['cost'] = $data->getCost(); $array['supplier'] = $supplier->getCompanyName(); $return[] = $array; } return $return; }