PHP Class eZ\Publish\Core\REST\Server\Service\ExpressionRouterRootResourceBuilder

This class builds a Root from an array building the href's using ExpressionLanguage to build href's from the router or templateRouter. Example $resourceConfig structure: array( 'content' => array( 'mediaType' => '', 'href' => 'router.generate("ezpublish_rest_listContentTypes")', ), 'usersByRoleId' => array( 'mediaType' => 'UserRefList', 'href' => 'templateRouter.generate("ezpublish_rest_loadUsers", {roleId: "{roleId}"})', ), )
Inheritance: implements eZ\Publish\Core\REST\Server\Service\RootResourceBuilderInterface
Show file Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$resourceConfig array
$router Symfony\Component\Routing\RouterInterface
$templateRouter Symfony\Component\Routing\RouterInterface

Public Methods

Method Description
__construct ( Symfony\Component\Routing\RouterInterface $router, Symfony\Component\Routing\RouterInterface $templateRouter, array $resourceConfig ) Creates a new resource builder.
buildRootResource ( ) : array | Root Build root resource.

Method Details

__construct() public method

Creates a new resource builder.
public __construct ( Symfony\Component\Routing\RouterInterface $router, Symfony\Component\Routing\RouterInterface $templateRouter, array $resourceConfig )
$router Symfony\Component\Routing\RouterInterface
$templateRouter Symfony\Component\Routing\RouterInterface
$resourceConfig array

buildRootResource() public method

Build root resource.
public buildRootResource ( ) : array | Root
return array | eZ\Publish\Core\REST\Common\Values\Root

Property Details

$resourceConfig protected property

protected array $resourceConfig
return array

$router protected property

protected RouterInterface,Symfony\Component\Routing $router
return Symfony\Component\Routing\RouterInterface

$templateRouter protected property

protected RouterInterface,Symfony\Component\Routing $templateRouter
return Symfony\Component\Routing\RouterInterface