<?php
namespace Modules\Orders\Details\OrderCompanies; class Model extends \Engine\Mvc\ModelAbstract { protected $idOrder; public function __construct($idOrder) { $this->idOrder = $idOrder; } public function getCompaniesList(): array { $idCorporatesList = \Entity\Order::select($this->idOrder)->idCorporatesList; if ($idCorporatesList) { $listObj = new \App\EntityList\Corporates(); $listObj->setColumns(['alias' => 'name', 'type', 'company', 'companyPrefix', 'companySuffix', 'fiscalCode', 'status']); $listObj->setFilter('id', 'IN', $idCorporatesList); return $listObj->exportRecords(); } return []; } } 