Author: Vojtěch Kohout
Inheritance: implements leanmapper\IMapper
Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 /**
  * 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);
 }
Esempio n. 3
0
 /**
  * @inheritdoc
  */
 public function getTableByRepositoryClass($repositoryClass)
 {
     if (isset($this->repositories[$repositoryClass])) {
         return $this->repositories[$repositoryClass];
     }
     return parent::getTableByRepositoryClass($repositoryClass);
 }