<?php
 namespace App\ReportsData\Populate\Entity; class Order extends \App\ReportsData\Populate\GeneralAbstract { protected function getDbTableName() { global $DBTRd_orders; return $DBTRd_orders; } protected function getEntityFields() { $entity = \Entity\Order::select($this->id); if (!$entity->recordExists()) { return null; } $return = [ 'id' => $this->id, 'convertedId' => $entity->convertedId, 'orderNumber' => $entity->reservationNumber, 'orderCode' => $entity->reservationCode, 'idAutoProcessRule' => $entity->idAutoProcessRule, 'orderType' => $entity->resType, 'flag' => $entity->flag, 'servicesType' => $entity->servicesType, 'date' => $entity->date, 'idCustomerOwner' => $entity->idCustomerOwner, 'idCustomers' => ($entity->idCustomersList ? json_encode($entity->idCustomersList) : ''), 'idCorporateOwner' => $entity->idCorporateOwner, 'idCorporateOwnerOffice' => $entity->idCorporateOwnerOffice, 'corporateOwnerOfficeCostCenter' => $entity->corporateOwnerOfficeCostCenter, 'idCorporates' => ($entity->idCorporatesList ? json_encode($entity->idCorporatesList) : ''), 'idContactPerson' => $entity->idContactPerson, 'pax' => $entity->pax, 'undefinedPaxDetails' => ($entity->undefinedPax ? json_encode($entity->undefinedPax) : ''), 'startDate' => $entity->startDate, 'endDate' => $entity->endDate, 'idMiceProject' => $entity->idMiceProject, 'description' => $entity->description, 'notes' => $entity->notes, 'comments' => $entity->comments, 'statusOp' => $entity->statusOp, 'statusFin' => $entity->statusFin, 'genDocsAssoc' => ($entity->generatedDocumentsAssoc ? json_encode($entity->generatedDocumentsAssoc) : ''), 'idUser' => $entity->idUser, 'idOffice' => $entity->idOffice, 'idDepartment' => $entity->idDepartment, 'idAddUser' => $entity->idAddUser, 'addTime' => \Engine\DateTime::createFromTimestamp($entity->addTime)->formatDatetimeIso(), 'lastUpdateTime' => ( $entity->lastUpdateTime ? \Engine\DateTime::createFromTimestamp($entity->lastUpdateTime)->formatDatetimeIso() : null ), 'idUpdateUser' => $entity->idUpdateUser, 'updatesCount' => $entity->updatesCount, ]; return $return; } } 