Example #1
0
 /**
  * Get all the routes in the repository that are under one of the
  * configured prefixes. This respects the limit.
  *
  * @return array
  */
 private function getAllRoutes()
 {
     if (0 === $this->routeCollectionLimit) {
         return array();
     }
     /** @var $dm DocumentManager */
     $dm = $this->getObjectManager();
     $qb = $dm->createQueryBuilder();
     $qb->from('d')->document('Symfony\\Component\\Routing\\Route', 'd');
     $this->candidatesStrategy->restrictQuery($qb);
     $query = $qb->getQuery();
     if ($this->routeCollectionLimit) {
         $query->setMaxResults($this->routeCollectionLimit);
     }
     return $query->getResult();
 }
 /**
  * Get all the routes in the repository that are under one of the
  * configured prefixes. This respects the limit.
  *
  * @return array
  */
 private function getAllRoutes()
 {
     if (0 === $this->routeCollectionLimit) {
         return array();
     }
     try {
         /** @var $dm DocumentManager */
         $dm = $this->getObjectManager();
     } catch (RepositoryException $e) {
         // special case: there is not even a database existing. this means there are no routes.
         if ($e->getPrevious() instanceof TableNotFoundException) {
             return array();
         }
         throw $e;
     }
     $qb = $dm->createQueryBuilder();
     $qb->from('d')->document('Symfony\\Component\\Routing\\Route', 'd');
     $this->candidatesStrategy->restrictQuery($qb);
     $query = $qb->getQuery();
     if ($this->routeCollectionLimit) {
         $query->setMaxResults($this->routeCollectionLimit);
     }
     return $query->getResult();
 }