kernel/private/rest/classes/controllers/rest_controller.php

Show: inherited
Table of Contents

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

Package: Default

Abstract class that must be extended by every REST controller

Parent(s)
\ezcMvcController

Constants

Constantstring  CACHE_ID = 'ezpRestMvcController'

Cache ID for ezcCache

string

Properties

Propertyprivatearray  $defaultResponsegroups= 'array()'

Default response groups returned by the controller

Default valuearray()Details
Type
array
Propertypublicbool  $isCacheCreated= 'false'
static

Flag to indicate wether application cache has been created by ezcCacheManager or not

Default valuefalseDetails
Type
bool
Propertyprotected\eZINI  $restINI= ''

Details
Type
\eZINI

Methods

methodpublic__construct( string $action, \ezcMvcRequest $request ) : void

Constructor

Parameters
Name Type Description
$action string
$request \ezcMvcRequest
methodpubliccreateResult( ) : void

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

Details
See
\lib/ezc/MvcTools/src/interfaces/ezcMvcController::createResult()  
methodprivategenerateCacheId( ) : 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...)

Returns
Type Description
string
methodprivategetActionTTL( ) : 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 [__CacheSettings] section (see comments in rest.ini).

Returns
Type Description
int TTL in seconds
methodprotectedgetAllContentVariables( ) : array

Returns all provided content variables in requested REST URI

Returns
Type Description
array
methodpublicgetCacheLocation( ) : string

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

Returns
Type Description
string Path in the cluster
methodprotectedgetContentVariable( string $name ) : string | null

Returns requested content variable, is it set

Parameters
Name Type Description
$name string

Content variable name

Returns
Type Description
string | null
methodprotectedgetResponseGroups( ) : array

Returns requested response groups

Returns
Type Description
array
methodprotectedhasContentVariable( string $name ) : bool

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

Parameters
Name Type Description
$name string

Content variable name

Returns
Type Description
bool
methodprotectedhasResponseGroup( string $name ) : bool

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

Parameters
Name Type Description
$name string

Response group name

Returns
Type Description
bool
methodprivateisCacheEnabled( ) : 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 [__CacheSettings] section (see comments in rest.ini).

Returns
Type Description
bool
methodprotectedsetDefaultResponseGroups( array $defaultResponseGroups ) : void

Sets default response groups

Parameters
Name Type Description
$defaultResponseGroups array
Documentation was generated by DocBlox 0.18.1.