<?php
 namespace App\Reports\Sources\OrdersList; class PopulateLoopRecords extends \App\Reports\Sources\PopulateLoopRecordsAbstract { protected array $processStandardColumns = [ 'ord_corporateIdsList', 'ord_corporateAliasList', 'ord_customerIdsList', 'ord_customerNamesList', ]; protected function updateReportStdColumns(array $currentRow) :array { $tableColumns = $this->columnsManager->getStdColumns(); $updateColumns = []; if ($tableColumns['ord_corporateAliasList'] or $tableColumns['ord_corporateIdsList']) { $order = new \App\ReportsData\EntityFields\Order($currentRow['ord_id']); $idCorporates = $order->getValue('idCorporates'); if ($tableColumns['ord_corporateIdsList']) { $updateColumns['ord_corporateIdsList'] = implode(', ', $idCorporates); } if ($tableColumns['ord_corporateAliasList']) { if ($idCorporates) { $corporates = []; foreach ($idCorporates as $idCorp) { $corpObj = new \App\ReportsData\EntityFields\Corporate($idCorp); $corporates[] = $corpObj->getValue('alias'); } $updateColumns['ord_corporateAliasList'] = implode(', ', $corporates); } else { $updateColumns['ord_corporateAliasList'] = ''; } } } if ($tableColumns['ord_customerIdsList'] or $tableColumns['ord_customerNamesList']) { $order = new \App\ReportsData\EntityFields\Order($currentRow['ord_id']); $idCustomers = $order->getValue('idCustomers'); if ($tableColumns['ord_customerIdsList']) { $updateColumns['ord_customerIdsList'] = implode(', ', $idCustomers); } if ($tableColumns['ord_customerNamesList']) { if ($idCustomers) { $customers = []; foreach ($idCustomers as $idCust) { $custObj = new \App\ReportsData\EntityFields\Customer($idCust); $customers[] = $custObj->getValue('fullNameStd'); } $updateColumns['ord_customerNamesList'] = implode(', ', $customers); } else { $updateColumns['ord_customerNamesList'] = ''; } } } return $updateColumns; } }