<?php
namespace Entity; class GalileoService extends \App\Entity\GDSServiceAbstract { const systemCode = 'galileo'; protected function getFile($idFile) { return \Entity\GalileoFile::select($idFile); } public function getStorageObjInstance() { return \App\Galileo\Storage\StorageHandler::getInstance(); } protected function setTableName(): void { global $DBTGalileoServices; $this->tableName = $DBTGalileoServices; } protected function getAttribute($var) { switch ($var) { case 'TINABookUser': return User::select($this->fields['idTINABookUser']); case 'TINAIssueUser': return User::select($this->fields['idTINAIssueUser']); 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 'idGalileoBookUser': case 'idGalileoIssueUser': case 'idGalileoBookOffice': case 'idGalileoIssueOffice': case 'idTINABookUser': case 'idTINAIssueUser': case 'idTINABookOffice': case 'idTINAIssueOffice': { $this->fields[$var] = $value; break; } default: { return parent::setAttribute($var, $value); } } } } 