eZPublish  4.5
ezpRestMvcController Class Reference

File containing ezpRestMvcController class. More...

+ Inheritance diagram for ezpRestMvcController:
+ Collaboration diagram for ezpRestMvcController:

Public Member Functions

 __construct ($action, ezcMvcRequest $request)
 Constructor. More...
 
 createResult ()
 Override to add the "requestedResponseGroups" variable for every REST requests. More...
 
 getCacheLocation ()
 Returns cache location for current API/version/controller/action. More...
 

Public Attributes

const CACHE_ID = 'ezpRestMvcController'
 

Static Public Attributes

static $isCacheCreated = false
 

Protected Member Functions

 getAllContentVariables ()
 Returns all provided content variables in requested REST URI. More...
 
 getContentVariable ($name)
 Returns requested content variable, is it set. More...
 
 getResponseGroups ()
 Returns requested response groups. More...
 
 hasContentVariable ($name)
 Checks if a content variable has been provided in requested REST URI. More...
 
 hasResponseGroup ($name)
 Checks if a response group has been provided in the requested REST URI. More...
 
 setDefaultResponseGroups (array $defaultResponseGroups)
 Sets default response groups. More...
 

Protected Attributes

 $restINI
 

Private Member Functions

 generateCacheId ()
 Generates unique cache ID for current request. More...
 
 getActionTTL ()
 Returns cache TTL value for current action as set in rest.ini Default value will be [CacheSettings].DefaultCacheTTL. More...
 
 isCacheEnabled ()
 Checks if application cache is enabled for this controller/action, as set in rest.ini Default value will be [CacheSettings].ApplicationCache This can be refined by setting a [<controllerClass>_<action>_CacheSettings] section (see comments in rest.ini). More...
 

Private Attributes

 $defaultResponsegroups = array()
 

Detailed Description

File containing ezpRestMvcController class.

Constructor & Destructor Documentation

ezpRestMvcController::__construct (   $action,
ezcMvcRequest  $request 
)

Constructor.

Parameters
string$action
ezcMvcRequest$request

Member Function Documentation

ezpRestMvcController::createResult ( )

Override to add the "requestedResponseGroups" variable for every REST requests.

See Also
lib/ezc/MvcTools/src/interfaces/ezcMvcController::createResult()
ezpRestMvcController::generateCacheId ( )
private

Generates unique cache ID for current request.

The cache ID is a MD5 hash and takes into account :

  • API Name
  • API Version
  • Controller class
  • Action
  • Internal variables (passed parameters, ResponseGroups...)
  • Content variables (Translation...)
    Returns
    string

Referenced by createResult().

ezpRestMvcController::getActionTTL ( )
private

Returns cache TTL value for current action as set in rest.ini Default value will be [CacheSettings].DefaultCacheTTL.

This can be refined by setting a [<controllerClass>_<action>_CacheSettings] section (see comments in rest.ini).

Returns
int TTL in seconds

Referenced by createResult().

ezpRestMvcController::getAllContentVariables ( )
protected

Returns all provided content variables in requested REST URI.

Returns
array
ezpRestMvcController::getCacheLocation ( )

Returns cache location for current API/version/controller/action.

Returns
string Path in the cluster

Referenced by createResult().

ezpRestMvcController::getContentVariable (   $name)
protected

Returns requested content variable, is it set.

Parameters
string$nameContent variable name
Returns
string|null
ezpRestMvcController::getResponseGroups ( )
protected

Returns requested response groups.

Returns
array

Referenced by createResult().

ezpRestMvcController::hasContentVariable (   $name)
protected

Checks if a content variable has been provided in requested REST URI.

Parameters
string$nameContent variable name
Returns
bool
ezpRestMvcController::hasResponseGroup (   $name)
protected

Checks if a response group has been provided in the requested REST URI.

Parameters
string$nameResponse group name
Returns
bool
ezpRestMvcController::isCacheEnabled ( )
private

Checks if application cache is enabled for this controller/action, as set in rest.ini Default value will be [CacheSettings].ApplicationCache This can be refined by setting a [<controllerClass>_<action>_CacheSettings] section (see comments in rest.ini).

Returns
bool

Referenced by createResult().

ezpRestMvcController::setDefaultResponseGroups ( array  $defaultResponseGroups)
protected

Sets default response groups.

Parameters
array$defaultResponseGroups
Returns
void

Member Data Documentation

ezpRestMvcController::$defaultResponsegroups = array()
private
ezpRestMvcController::$isCacheCreated = false
static
ezpRestMvcController::$restINI
protected
const ezpRestMvcController::CACHE_ID = 'ezpRestMvcController'

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