public function repository($entity)
    {
        if (!is_string($entity)) {
            $entity = get_class($entity);
        }

        // First we check if the repository is not already created.
        if (array_key_exists($entity, $this->repositories)) {
            return $this->repositories[$entity];
        }

        $this->repositories[$entity] = new Repository($this->mapper($entity));

        return $this->repositories[$entity];
    }
public function repository($entity)
    {
        if (!is_string($entity)) {
            $entity = get_class($entity);
        }

        // First we check if the repository is not already created.
        if (array_key_exists($entity, $this->repositories)) {
            return $this->repositories[$entity];
        }

        $this->repositories[$entity] = new Repository($this->mapper($entity));

        return $this->repositories[$entity];
    }
public function repository ( $ entity ) { if ( ! is_string ( $ entity ) ) { $ entity = get_class ( $ entity ) ; } // First we check if the repository is not already created. if ( array_key_exists ( $ entity , $ this -> repositories ) ) { return $ this -> repositories [ $ entity ] ; } $ this -> repositories [ $ entity ] = new Repository ( $ this -> mapper ( $ entity ) ) ; return $ this -> repositories [ $ entity ] ; }
Get the Repository instance for the given Entity.

@param \Analogue\ORM\Mappable|string $entity

@throws \InvalidArgumentException
@throws MappingException

@return \Analogue\ORM\Repository
Get the Repository instance for the given Entity .