<?php
 namespace App\EntityList; class OrderServiceOffers extends GeneralMtAbstract { public function __construct() { global $DBTReservationServices, $DBTReservations, $DBTReservationServiceOffers; $this->tableName = $DBTReservationServiceOffers; $this->tableAlias = 'off'; $this->allowedTables['off']= ['table'=>$DBTReservationServiceOffers, 'type'=>'month']; $this->allowedTables['serv']= ['table'=>$DBTReservationServices, 'type'=>'month', 'foreignKeyRef'=>"serv.id=off.idReservationService", 'joinType'=>'INNER']; $this->allowedTables['res']= ['table'=>$DBTReservations, 'type'=>'month', 'foreignKeyRef'=>"res.id=serv.idReservation", 'joinType'=>'INNER']; parent::__construct(); $this->setColumn('off.id', 'id'); } public function getMonthTablesList(): array { $tableMonths_id1=$this->getMonthTablesList_id(['off.id']); $tableMonths_id2=$this->getMonthTablesList_id(['off.idReservationService']); $tableMonths_id3=$this->getMonthTablesList_id(['serv.id']); $tableMonths_id4=$this->getMonthTablesList_id(['serv.idReservation']); $tableMonths_id5=$this->getMonthTablesList_id(['res.id']); $tableMonths_resDate=$this->getMonthTablesList_reservationDate(); $tableMonths=array_intersect($tableMonths_id1, $tableMonths_id2, $tableMonths_id3, $tableMonths_id4, $tableMonths_id5, $tableMonths_resDate); return $tableMonths; } private function getMonthTablesList_reservationDate() { $period=$this->getMonthTablesList_period(['res.date']); if ($period['startDate']>$period['endDate']) return []; $resMonthsList = array_keys( \App\Utils\Db\TablesUtilsCached::getInstance()->getExistingMonthTablesByInterval($this->tableName, $period['startDate'], $period['endDate']) ); return $resMonthsList; } protected function addUserRestrictionFilter() { } } 