<?php
namespace Entity; class ApolloService extends \App\Entity\GDSServiceAbstract { const systemCode = 'apollo'; protected function getFile($idFile) { return \Entity\ApolloFile::select($idFile); } public function getStorageObjInstance() { return \App\Apollo\Storage\StorageHandler::getInstance(); } protected function setTableName(): void { global $DBTApolloServices; $this->tableName = $DBTApolloServices; } protected function getAttribute($var) { switch ($var) { case 'TINABookUser': return User::select($this->fields['idTINABookUser']); case 'TINAIssueUser': return User::select($this->fields['idTINAIssueUser']); case 'RECLOC': return substr($this->getAttribute('transactionCode'), 0, 6); case 'PNRRootService': if (!array_key_exists($var, $this->fields)) { $this->fields[$var] = $this->getAttribute_PNRRootService_using_references(); } return $this->fields[$var]; case 'PNRFiles': $ret = []; $references = $this->getAllRelatedReferences(); foreach ($references as $refId) { $ret[self::select($refId)->idFile] = $this->getFile(self::select($refId)->idFile); } return array_values($ret); default: { return parent::getAttribute($var); } } } protected function setAttribute($var, $value) { switch ($var) { case 'transactionCode': case 'idApolloBookUser': case 'idApolloIssueUser': case 'idApolloBookOffice': case 'idApolloIssueOffice': case 'idTINABookUser': case 'idTINAIssueUser': case 'idTINABookOffice': case 'idTINAIssueOffice': { $this->fields[$var] = $value; break; } default: { return parent::setAttribute($var, $value); } } } } 