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
falseDetails- Type
- bool
Methods

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

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

generateCacheId(
)
:
stringGenerates 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(
)
:
intReturns 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(
)
:
arrayReturns all provided content variables in requested REST URI
| Type | Description |
|---|---|
| array |

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

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

hasContentVariable(
string $name
)
:
boolChecks 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
)
:
boolChecks if a response group has been provided in the requested REST URI
| Name | Type | Description |
|---|---|---|
| $name | string | Response group name |
| Type | Description |
|---|---|
| bool |

isCacheEnabled(
)
:
boolChecks 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 |