<?php
 namespace App\ReportsData\Populate\Entity; class Office extends \App\ReportsData\Populate\GeneralAbstract { protected function getDbTableName() { global $DBTRd_offices; return $DBTRd_offices; } protected function getEntityFields() { $entity = \Entity\Office::select($this->id); if (!$entity->recordExists()) { return null; } $return = [ 'id' => $this->id, 'deleted' => $entity->deleted, 'name' => $entity->name, 'defaultOffice' => $entity->defaultOffice, 'iataCode' => implode(', ', $entity->iataCode), 'address' => $entity->address, 'deliveryAddress' => $entity->deliveryAddress, 'zipCode' => $entity->zipCode, 'countryCode' => $entity->countryCode, 'cityId' => $entity->cityId, 'telephone' => $entity->telephone, 'fax' => $entity->fax, 'email' => $entity->email, 'web' => $entity->web, 'comments' => $entity->comments, 'idDefaultBankAccount' => $entity->idDefaultBankAccount, 'remarks' => $entity->remarks, 'processedRemarks' => ($entity->processedRemarks ? json_encode($entity->processedRemarks) : ''), 'addTime' => \Engine\DateTime::createFromTimestamp($entity->addTime)->formatDatetimeIso(), 'idAddUser' => $entity->idAddUser, 'lastUpdateTime' => ( $entity->lastUpdateTime ? \Engine\DateTime::createFromTimestamp($entity->lastUpdateTime)->formatDatetimeIso() : null ), 'idUpdateUser' => $entity->idUpdateUser, 'updatesCount' => $entity->updatesCount, ]; return $return; } } 