<?php
 namespace Entity; class MiceProjectType extends \App\Entity\GeneralAbstract { protected $saveInsideTransaction = false; protected function setTableName(): void { global $DBTMiceProjectsTypes; $this->tableName=$DBTMiceProjectsTypes; } protected function getAttribute($var) { switch ($var) { case 'addUser': { return User::select($this->fields['idAddUser'], $this->selectForUpdate); } case 'updateUser': { return User::select($this->fields['idUpdateUser'], $this->selectForUpdate); } default: { return parent::getAttribute($var); } } } protected function setAttribute($var, $value) { if ($this->operation!='insert' and $this->operation!='update') { throw new \Exception('You can use __set magic method only with insert/update operation in `'.__CLASS__.'` class.'); } switch ($var) { case 'name': { $this->fields[$var]=$value; break; } default: { throw new \Exception("The field '$var' is not valid for the `".__CLASS__."` entity."); } } } } 