kernel/private/rest/classes/controllers/rest_controller.php
File containing ezpRestMvcController class
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- kernel
- Version
- 4.6.0
\ezpRestMvcController
Abstract class that must be extended by every REST controller
- Parent(s)
- \ezcMvcController
Constants
Properties


array
$defaultResponsegroups= 'array()'
Default response groups returned by the controller
array()
Details- Type
- array


bool
$isCacheCreated= 'false'
Flag to indicate wether application cache has been created by ezcCacheManager or not
false
Details- Type
- bool
Methods


__construct(
string $action, \ezcMvcRequest $request
)
:
void
Constructor
Name | Type | Description |
---|---|---|
$action | string | |
$request | \ezcMvcRequest |


createResult(
)
:
void
Override to add the "requestedResponseGroups" variable for every REST requests
- See
- \lib/ezc/MvcTools/src/interfaces/ezcMvcController::createResult()


generateCacheId(
)
:
string
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...)
Type | Description |
---|---|
string |


getActionTTL(
)
:
int
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 [
Type | Description |
---|---|
int | TTL in seconds |


getAllContentVariables(
)
:
array
Returns all provided content variables in requested REST URI
Type | Description |
---|---|
array |


getCacheLocation(
)
:
string
Returns cache location for current API/version/controller/action
Type | Description |
---|---|
string | Path in the cluster |


getContentVariable(
string $name
)
:
string | null
Returns requested content variable, is it set
Name | Type | Description |
---|---|---|
$name | string | Content variable name |
Type | Description |
---|---|
string | null |


hasContentVariable(
string $name
)
:
bool
Checks if a content variable has been provided in requested REST URI
Name | Type | Description |
---|---|---|
$name | string | Content variable name |
Type | Description |
---|---|
bool |


hasResponseGroup(
string $name
)
:
bool
Checks if a response group has been provided in the requested REST URI
Name | Type | Description |
---|---|---|
$name | string | Response group name |
Type | Description |
---|---|
bool |


isCacheEnabled(
)
:
bool
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 [
Type | Description |
---|---|
bool |