PHP Class eZ\Publish\Core\MVC\Symfony\SiteAccess\Router

Inheritance: implements eZ\Publish\Core\MVC\Symfony\SiteAccess\SiteAccessRouterInterface, implements eZ\Publish\Core\MVC\Symfony\SiteAccess\SiteAccessAware
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$defaultSiteAccess string Name of the default siteaccess.
$logger Psr\Log\LoggerInterface
$matcherBuilder eZ\Publish\Core\MVC\Symfony\SiteAccess\MatcherBuilderInterface
$request eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest
$siteAccess eZ\Publish\Core\MVC\Symfony\SiteAccess
$siteAccessClass
$siteAccessList array Siteaccess name is the key, "true" is the value.
$siteAccessesConfiguration array Consists in an hash indexed by matcher type class. Value is a hash where index is what to match against and value is the corresponding siteaccess name. Example: array( Using built-in URI matcher. Key is the prefix that matches the siteaccess, in the value "Map\\URI" => array( "ezdemo_site" => "ezdemo_site", "ezdemo_site_admin" => "ezdemo_site_admin", ), Using built-in HOST matcher. Key is the hostname, value is the siteaccess name "Map\\Host" => array( "ezpublish.dev" => "ezdemo_site", "ezpublish.admin.dev" => "ezdemo_site_admin", ), Using a custom matcher (class must begin with a '\', as a full qualified class name). The custom matcher must implement eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher interface. "\\My\\Custom\\Matcher" => array( "something_to_match_against" => "siteaccess_name" ) )

Public Methods

Method Description
__construct ( eZ\Publish\Core\MVC\Symfony\SiteAccess\MatcherBuilderInterface $matcherBuilder, Psr\Log\LoggerInterface $logger, string $defaultSiteAccess, array $siteAccessesConfiguration, array $siteAccessList, string | null $siteAccessClass = null ) Constructor.
getRequest ( ) : SimplifiedRequest
getSiteAccess ( ) : SiteAccess | null
match ( SimplifiedRequest $request ) : SiteAccess Performs SiteAccess matching given the $request.
matchByName ( string $siteAccessName ) : SiteAccess | null Matches a SiteAccess by name.
setSiteAccess ( SiteAccess $siteAccess = null )

Private Methods

Method Description
doMatch ( SimplifiedRequest $request ) : SiteAccess Returns the SiteAccess object matched against $request and the siteaccess configuration.

Method Details

__construct() public method

Constructor.
public __construct ( eZ\Publish\Core\MVC\Symfony\SiteAccess\MatcherBuilderInterface $matcherBuilder, Psr\Log\LoggerInterface $logger, string $defaultSiteAccess, array $siteAccessesConfiguration, array $siteAccessList, string | null $siteAccessClass = null )
$matcherBuilder eZ\Publish\Core\MVC\Symfony\SiteAccess\MatcherBuilderInterface
$logger Psr\Log\LoggerInterface
$defaultSiteAccess string
$siteAccessesConfiguration array
$siteAccessList array
$siteAccessClass string | null

getRequest() public method

public getRequest ( ) : SimplifiedRequest
return eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest

getSiteAccess() public method

public getSiteAccess ( ) : SiteAccess | null
return eZ\Publish\Core\MVC\Symfony\SiteAccess | null

match() public method

Performs SiteAccess matching given the $request.
public match ( SimplifiedRequest $request ) : SiteAccess
$request eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest
return eZ\Publish\Core\MVC\Symfony\SiteAccess

matchByName() public method

Returns corresponding SiteAccess object, according to configuration, with corresponding matcher. Returns null if no matcher can be found (e.g. non versatile).
public matchByName ( string $siteAccessName ) : SiteAccess | null
$siteAccessName string
return eZ\Publish\Core\MVC\Symfony\SiteAccess | null

setSiteAccess() public method

public setSiteAccess ( SiteAccess $siteAccess = null )
$siteAccess eZ\Publish\Core\MVC\Symfony\SiteAccess

Property Details

$defaultSiteAccess protected property

Name of the default siteaccess.
protected string $defaultSiteAccess
return string

$logger protected property

protected LoggerInterface,Psr\Log $logger
return Psr\Log\LoggerInterface

$matcherBuilder protected property

protected MatcherBuilderInterface,eZ\Publish\Core\MVC\Symfony\SiteAccess $matcherBuilder
return eZ\Publish\Core\MVC\Symfony\SiteAccess\MatcherBuilderInterface

$request protected property

protected SimplifiedRequest,eZ\Publish\Core\MVC\Symfony\Routing $request
return eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest

$siteAccess protected property

protected SiteAccess,eZ\Publish\Core\MVC\Symfony $siteAccess
return eZ\Publish\Core\MVC\Symfony\SiteAccess

$siteAccessClass protected property

protected $siteAccessClass

$siteAccessList protected property

Siteaccess name is the key, "true" is the value.
protected array $siteAccessList
return array

$siteAccessesConfiguration protected property

Consists in an hash indexed by matcher type class. Value is a hash where index is what to match against and value is the corresponding siteaccess name. Example: array( Using built-in URI matcher. Key is the prefix that matches the siteaccess, in the value "Map\\URI" => array( "ezdemo_site" => "ezdemo_site", "ezdemo_site_admin" => "ezdemo_site_admin", ), Using built-in HOST matcher. Key is the hostname, value is the siteaccess name "Map\\Host" => array( "ezpublish.dev" => "ezdemo_site", "ezpublish.admin.dev" => "ezdemo_site_admin", ), Using a custom matcher (class must begin with a '\', as a full qualified class name). The custom matcher must implement eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher interface. "\\My\\Custom\\Matcher" => array( "something_to_match_against" => "siteaccess_name" ) )
protected array $siteAccessesConfiguration
return array