public function getEntityRepository()
    {
        $repository = $this->entityManager->getRepository($this->getEntityName());

        if (!($repository instanceof EntityRepository)) {
            throw new InvalidEntityNameException($this->getEntityName(), $this->getEntityClass());
        }

        return $repository;
    }