Model/ModelManager.php
public function createQuery($class, $alias = 'o')
    {
        $repository = $this->getEntityManager($class)->getRepository($class);

        if ($repository instanceof SecuredEntityRepository) {
            return new ProxyQuery($repository->createSecuredQueryBuilder($alias));
        }

        return new ProxyQuery($repository->createQueryBuilder($alias));
    }
public function createQuery($class, $alias = 'o')
    {
        $repository = $this->getEntityManager($class)->getRepository($class);

        if ($repository instanceof SecuredEntityRepository) {
            return new ProxyQuery($repository->createSecuredQueryBuilder($alias));
        }

        return new ProxyQuery($repository->createQueryBuilder($alias));
    }
{@inheritdoc}