getType() public method

public getType ( ) : string
return string
Ejemplo n.º 1
0
 /**
  * Creates a route
  *
  * @param RouteInterface $resource
  *
  * @return null|SymfonyRoute
  */
 private function createRoute(RouteInterface $resource)
 {
     $route = null;
     foreach ($this->generators->all() as $generator) {
         if ($generator->supports($resource->getType())) {
             $route = $generator->generate($resource);
             break;
         }
     }
     if (null === $route) {
         throw new RouteNotFoundException(sprintf('No possible generator found for route "%s"', $resource->getId()));
     }
     return $route;
 }
Ejemplo n.º 2
0
 /**
  * Creates a route
  *
  * @param RouteInterface $resource
  *
  * @return null|SymfonyRoute
  */
 private function createRoute(RouteInterface $resource)
 {
     $route = null;
     /**
      * @var \WellCommerce\Bundle\RoutingBundle\Generator\RouteGeneratorInterface $generator
      */
     foreach ($this->generators as $generator) {
         if ($generator->supports($resource->getType())) {
             $route = $generator->generate($resource);
             break;
         }
     }
     if (null === $route) {
         throw new RouteNotFoundException(sprintf('No possible generator found for route "%s"', $resource->getId()));
     }
     return $route;
 }