Sulu\Bundle\RouteBundle\Routing\Defaults\RouteDefaultsProviderInterface::supports PHP Method

supports() public method

Returns true if this provider supports given entity-class.
public supports ( string $entityClass ) : boolean
$entityClass string
return boolean
    public function supports($entityClass);

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function getRouteByName($name)
 {
     if (strpos($name, self::ROUTE_PREFIX) !== 0) {
         throw new RouteNotFoundException();
     }
     $routeId = substr($name, strlen(self::ROUTE_PREFIX));
     if (array_key_exists($routeId, $this->symfonyRouteCache)) {
         return $this->symfonyRouteCache[$routeId];
     }
     /** @var RouteInterface $route */
     $route = $this->routeRepository->find($routeId);
     if (!$route || !$this->routeDefaultsProvider->supports($route->getEntityClass()) || !$this->routeDefaultsProvider->isPublished($route->getEntityClass(), $route->getEntityId(), $route->getLocale())) {
         throw new RouteNotFoundException();
     }
     return $this->createRoute($route, $this->requestStack->getCurrentRequest());
 }
All Usage Examples Of Sulu\Bundle\RouteBundle\Routing\Defaults\RouteDefaultsProviderInterface::supports
RouteDefaultsProviderInterface