src/components/EntityManager.php
public function getRepository($entityClass)
    {
        if (is_object($entityClass)) {
            $entityClass = get_class($entityClass);
        }

        if (!isset($this->repositories[$entityClass])) {
            throw new \Exception("no repository defined for: $entityClass");
        }

        if (!is_object($this->repositories[$entityClass])) {
            $this->repositories[$entityClass] = $this->di->get($this->repositories[$entityClass]);
        }

        return $this->repositories[$entityClass];
    }
public function getRepository($entityClass)
    {
        if (is_object($entityClass)) {
            $entityClass = get_class($entityClass);
        }

        if (!isset($this->repositories[$entityClass])) {
            throw new \Exception("no repository defined for: $entityClass");
        }

        if (!is_object($this->repositories[$entityClass])) {
            $this->repositories[$entityClass] = $this->di->get($this->repositories[$entityClass]);
        }

        return $this->repositories[$entityClass];
    }
public function getRepository ( $ entityClass ) { if ( is_object ( $ entityClass ) ) { $ entityClass = get_class ( $ entityClass ) ; } if ( ! isset ( $ this -> repositories [ $ entityClass ] ) ) { throw new \ Exception ( "no repository defined for: $entityClass" ) ; } if ( ! is_object ( $ this -> repositories [ $ entityClass ] ) ) { $ this -> repositories [ $ entityClass ] = $ this -> di -> get ( $ this -> repositories [ $ entityClass ] ) ; } return $ this -> repositories [ $ entityClass ] ; }
Get entity repository by entity or class.
@param object|string $entityClass entity or class
@return BaseRepository
Get entity repository by entity or class .