public function getEntityClass($table, Row $row = NULL) { if ($table === 'salaries') { return $this->defaultEntityNamespace . '\\Salary'; } if ($table === 'departments') { return $this->defaultEntityNamespace . '\\Department'; } if ($table === 'employees') { return $this->defaultEntityNamespace . '\\Employee'; } return parent::getEntityClass($table, $row); }
/** * Gets fully qualified entity class name from given table name * * @param string $table * @param Row|null $row * @return string */ public function getEntityClass($table, Row $row = NULL) { if (isset($this->tableToRepositoryMapping[$table])) { $repository = get_class($this->tableToRepositoryMapping[$table]); if (isset($this->repositoryToEntityMapping[$repository])) { return $this->repositoryToEntityMapping[$repository]; } } return parent::getEntityClass($table, $row); }
/** * @inheritdoc */ public function getTableByRepositoryClass($repositoryClass) { if (isset($this->repositories[$repositoryClass])) { return $this->repositories[$repositoryClass]; } return parent::getTableByRepositoryClass($repositoryClass); }