public function getRepository(string $entity): Repository
    {
        if (isset($this->repositories[$entity])) {
            return $this->repositories[$entity];
        }

        /** @var Entity|string $entity */
        $repository = $entity::getRepository() ?? PDORepository::class;

        return $this->repositories[$entity] = new $repository($this, $entity, $entity::getTable());
    }
public function getRepository(string $entity): Repository
    {
        if (isset($this->repositories[$entity])) {
            return $this->repositories[$entity];
        }

        /** @var Entity|string $entity */
        $repository = $entity::getRepository() ?? PDORepository::class;

        return $this->repositories[$entity] = new $repository($this, $entity, $entity::getTable());
    }
public function getRepository ( string $ entity ) : Repository { if ( isset ( $ this -> repositories [ $ entity ] ) ) { return $ this -> repositories [ $ entity ] ; } /** @var Entity|string $entity */ $ repository = $ entity :: getRepository ( ) ?? PDORepository :: class ; return $ this -> repositories [ $ entity ] = new $ repository ( $ this , $ entity , $ entity :: getTable ( ) ) ; }
Get a repository instance.

@param string $entity

@return Repository
Get a repository instance .