Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ezpRestMvcController Class Reference
Inheritance diagram for ezpRestMvcController:

## Public Member Functions
| __construct ( $action, ezcMvcRequest $request)
| createResult ()
| doHttpOptions ()
| getCacheLocation ()

## Public Attributes
const | CACHE_ID = 'ezpRestMvcController'

## Static Public Attributes
static | $isCacheCreated = false

## Protected Member Functions
| hasResponseGroup ( $name)
| getResponseGroups ()
| setDefaultResponseGroups (array $defaultResponseGroups)
| hasContentVariable ( $name)
| getContentVariable ( $name)
| getAllContentVariables ()

## Protected Attributes
| $restINI

## Private Member Functions
| getActionTTL ()
| generateCacheId ()
| isCacheEnabled ()

## Private Attributes
| $defaultResponsegroups = array()

## Detailed Description

Abstract class that must be extended by every REST controller

Definition at line 15 of file rest_controller.php.

## Constructor & Destructor Documentation

## ◆ __construct()

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

Constructor

Parameters

  string | $action |
  ezcMvcRequest | $request |

Definition at line 49 of file rest_controller.php.

## Member Function Documentation

## ◆ createResult()

ezpRestMvcController::createResult | ( |  | ) |

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

See also
  lib/ezc/MvcTools/src/interfaces/ezcMvcController::createResult()

Definition at line 144 of file rest_controller.php.

References $debug, $res, generateCacheId(), getActionTTL(), getCacheLocation(), ezpRestDebug\getInstance(), getResponseGroups(), isCacheEnabled(), and ezpRestDebug\isDebugEnabled().

## ◆ doHttpOptions()

ezpRestMvcController::doHttpOptions | ( |  | ) |

Default action to handle OPTIONS requests.

Returns
  ezcMvcResult

Definition at line 215 of file rest_controller.php.

References $result, and ezpHttpResponseCodes\OK.

## ◆ generateCacheId()

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

Definition at line 282 of file rest_controller.php.

References $name, ezpRestPrefixFilterInterface\getApiProviderName(), and ezpRestPrefixFilterInterface\getApiVersion().

Referenced by createResult().

## ◆ getActionTTL()

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

Definition at line 249 of file rest_controller.php.

Referenced by createResult().

## ◆ getAllContentVariables()

ezpRestMvcController::getAllContentVariables | ( |  | ) |
| protected

Returns all provided content variables in requested REST URI

Returns
  array

Definition at line 134 of file rest_controller.php.

## ◆ getCacheLocation()

ezpRestMvcController::getCacheLocation | ( |  | ) |

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

Returns
  string Path in the cluster

Definition at line 232 of file rest_controller.php.

References ezpRestPrefixFilterInterface\getApiProviderName(), and ezpRestPrefixFilterInterface\getApiVersion().

Referenced by createResult().

## ◆ getContentVariable()

ezpRestMvcController::getContentVariable | ( |  | $name | ) |
| protected

Returns requested content variable, is it set

Parameters

  string | $name | Content variable name

Returns
  string|null

Definition at line 119 of file rest_controller.php.

References $name.

## ◆ getResponseGroups()

ezpRestMvcController::getResponseGroups | ( |  | ) |
| protected

Returns requested response groups

Returns
  array

Definition at line 76 of file rest_controller.php.

References $i.

Referenced by createResult().

## ◆ hasContentVariable()

ezpRestMvcController::hasContentVariable | ( |  | $name | ) |
| protected

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

Parameters

  string | $name | Content variable name

Returns
  bool

Definition at line 107 of file rest_controller.php.

References $name.

## ◆ hasResponseGroup()

ezpRestMvcController::hasResponseGroup | ( |  | $name | ) |
| protected

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

Parameters

  string | $name | Response group name

Returns
  bool

Definition at line 62 of file rest_controller.php.

References $name.

## ◆ isCacheEnabled()

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

Definition at line 310 of file rest_controller.php.

Referenced by createResult().

## ◆ setDefaultResponseGroups()

ezpRestMvcController::setDefaultResponseGroups | ( | array | $defaultResponseGroups | ) |
| protected

Sets default response groups

Parameters

  array | $defaultResponseGroups |

Returns
  void

Definition at line 95 of file rest_controller.php.

## Member Data Documentation

## ◆ $defaultResponsegroups

ezpRestMvcController::$defaultResponsegroups = array()
| private

Definition at line 29 of file rest_controller.php.

## ◆ $isCacheCreated

ezpRestMvcController::$isCacheCreated = false
| static

Definition at line 41 of file rest_controller.php.

## ◆ $restINI

ezpRestMvcController::$restINI
| protected

Definition at line 34 of file rest_controller.php.

## ◆ CACHE_ID

const ezpRestMvcController::CACHE_ID = 'ezpRestMvcController'

Definition at line 22 of file rest_controller.php.

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

- rest_controller.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.