eZPublishCommunityProject(LegacyStack)  2013.6
ezpRestPrefixFilterInterface Class Reference
+ Inheritance diagram for ezpRestPrefixFilterInterface:

Public Member Functions

 __construct (ezcMvcRequest $request, $apiPrefix)
 Creates a new VersionToken object which describes the version token in API strings. More...
 
 filter ()
 Filters the request object for API provider and version token. More...
 
 filterRequestUri ()
 Filters the URI property of the given ezcMvcRequest object, removing any version token from it. More...
 

Static Public Member Functions

static getApiPrefix ()
 Returns a global API prefix. More...
 
static getApiProviderName ()
 Returns the name of the referenced API provider for the current query. More...
 
static getApiVersion ()
 Returns the version number of the API call. More...
 

Protected Member Functions

 parseVersionValue ()
 Returns the numerical version of the version token. More...
 

Protected Attributes

 $apiProviderToken
 
 $request
 
 $versionToken
 

Static Protected Attributes

static $apiPrefix = null
 
static $apiProvider = null
 
static $version = null
 

Constructor & Destructor Documentation

ezpRestPrefixFilterInterface::__construct ( ezcMvcRequest  $request,
  $apiPrefix 
)
abstract

Creates a new VersionToken object which describes the version token in API strings.

Parameters
ezcMvcRequest$request
string$apiPrefixThe API prefix of HTTP requests going to the REST interface.

Member Function Documentation

ezpRestPrefixFilterInterface::filter ( )
abstract

Filters the request object for API provider and version token.

The API provider is by default assumed to be the first URI element. Other custom implementations of this interface are free to choose otherwise.

If version token exists, gets the numerical value of this token, and filters the URI in the request object, removing said token.

This lets us not to deal with any version token data, in our route definitions. This is a benefit, since different systems, might have different preferences for what the version token should look like.

Returns
void
ezpRestPrefixFilterInterface::filterRequestUri ( )

Filters the URI property of the given ezcMvcRequest object, removing any version token from it.

Returns
void
static ezpRestPrefixFilterInterface::getApiPrefix ( )
static

Returns a global API prefix.

Returns
false|string

Referenced by ezpRestVersionedRoute\generateUrl().

static ezpRestPrefixFilterInterface::getApiProviderName ( )
static

Returns the name of the referenced API provider for the current query.

Returns
false|string The identifier of the API provider used in this query.

Referenced by ezpMvcConfiguration\createView(), ezpRestRouter\doCreateRoutes(), ezpRestMvcController\generateCacheId(), ezpRestVersionedRoute\generateUrl(), ezpRestRequest\getBaseURI(), ezpRestRouter\getCachedRoutes(), and ezpRestMvcController\getCacheLocation().

static ezpRestPrefixFilterInterface::getApiVersion ( )
static

Returns the version number of the API call.

If no version is found in the request, it defaults to '1'.

Returns
int The version number of the API call.

Referenced by ezpRestIniRouteFilter\checkRoute(), ezpRestMvcController\generateCacheId(), ezpRestMvcController\getCacheLocation(), and ezpRestVersionedRoute\matches().

ezpRestPrefixFilterInterface::parseVersionValue ( )
abstractprotected

Returns the numerical version of the version token.

Returns
int version value

Member Data Documentation

ezpRestPrefixFilterInterface::$apiPrefix = null
staticprotected
ezpRestPrefixFilterInterface::$apiProvider = null
staticprotected
ezpRestPrefixFilterInterface::$apiProviderToken
protected
ezpRestPrefixFilterInterface::$request
protected
ezpRestPrefixFilterInterface::$version = null
staticprotected
ezpRestPrefixFilterInterface::$versionToken
protected

Referenced by filterRequestUri().


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