eZPublishCommunityProject  2013.9
eZ\Bundle\EzPublishRestBundle\RequestParser\Router Class Reference

Router based request parser. More...

+ Inheritance diagram for eZ\Bundle\EzPublishRestBundle\RequestParser\Router:
+ Collaboration diagram for eZ\Bundle\EzPublishRestBundle\RequestParser\Router:

Public Member Functions

 __construct ($restRoutesPrefix, RouterInterface $router)
 
 generate ($type, array $values=array())
 Generate a URL of the given type from the specified values. More...
 
 parse ($url)
 
 parseHref ($href, $attribute)
 

Private Member Functions

 matchesRestRequest (array $match)
 Checks if a router match response matches a REST resource. More...
 

Private Attributes

 $restRoutesPrefix
 
 $router
 

Detailed Description

Router based request parser.

Constructor & Destructor Documentation

eZ\Bundle\EzPublishRestBundle\RequestParser\Router::__construct (   $restRoutesPrefix,
RouterInterface  $router 
)

Member Function Documentation

eZ\Bundle\EzPublishRestBundle\RequestParser\Router::generate (   $type,
array  $values = array() 
)

Generate a URL of the given type from the specified values.

Parameters
string$type
array$values
Returns
string

Implements eZ\Publish\Core\REST\Common\RequestParser.

eZ\Bundle\EzPublishRestBundle\RequestParser\Router::matchesRestRequest ( array  $match)
private

Checks if a router match response matches a REST resource.

Parameters
array$matchMatch array returned by Router::match() / Router::matchRequest()
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\InvalidArgumentExceptionif the $match isn't valid
Returns
bool

Referenced by eZ\Bundle\EzPublishRestBundle\RequestParser\Router\parse().

eZ\Bundle\EzPublishRestBundle\RequestParser\Router::parse (   $url)
Exceptions
ResourceNotFoundExceptionIf no match was found

Implements eZ\Publish\Core\REST\Common\RequestParser.

Referenced by eZ\Bundle\EzPublishRestBundle\RequestParser\Router\parseHref().

eZ\Bundle\EzPublishRestBundle\RequestParser\Router::parseHref (   $href,
  $attribute 
)
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentExceptionIf $attribute wasn't found in the match

Implements eZ\Publish\Core\REST\Common\RequestParser.

Member Data Documentation

eZ\Bundle\EzPublishRestBundle\RequestParser\Router::$restRoutesPrefix
private
eZ\Bundle\EzPublishRestBundle\RequestParser\Router::$router
private

The documentation for this class was generated from the following file: