PHP Класс Sulu\Component\Rest\RestController

Наследование: extends FOS\RestBundle\Controller\FOSRestController
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$bundlePrefix string standard bundle prefix.
$entityKey string The key of the entity which will be used in the embedded part of the REST Response.
$entityName string The type of the entity, which is handled by the concrete controller.
$fieldTypes array contains the matching between fields and their types.
$fieldsDefault array contains fields that cannot be hidden and are visible by default.
$fieldsEditable array contains fields that are editable.
$fieldsExcluded array contains all fields that should be excluded from api.
$fieldsHidden array contains all fields that should be hidden by default from api.
$fieldsMinWidth contains the widths of the fields
$fieldsRelations array contains all field relations.
$fieldsSortOrder array contains sort order of elements: array(order => fieldName).
$fieldsTranslationKeys array contains custom translation keys like array(fieldName => translationKey).
$fieldsValidation array contains arrays of validation key-value data.
$fieldsWidth contains the widths of the fields
$sortable array contains all attributes that are sortable if defined unsortable gets ignored.
$unsortable array contains all attributes that are not sortable.

Открытые методы

Метод Описание
getLocale ( Request $request ) : mixed Returns the language.
replaceOrAddUrlString ( string $url, string $key, string $value, boolean $add = true ) : mixed | string function replaces a url parameter.
responseDelete ( $id, $deleteCallback ) : FOS\RestBundle\View\View Deletes the entity with the given id using the deleteCallback and return a successful response, or an error message with a 4xx status code.
responseFields ( ) : Response Creates a response which contains all fields of the current entity.
responsePersistSettings ( ) : Response

Защищенные методы

Метод Описание
addFieldAttributes ( $fields, $fieldsHidden = [] ) : array creates the translation keys array and sets the default attribute, if set also adds the type property for.
createHalResponse ( array $entities, boolean $returnListLinks = false ) : array creates HAL conform response-array out of an entity collection.
findMatch ( array $requestEntities, integer $id, array &$matchedEntry, string &$matchedKey ) Tries to find a given id in a given set of entities. Returns the entity itself and its key with the $matchedEntry and $matchKey parameters.
getHalLinks ( array $entities, integer $pages = 1, boolean $returnListLinks = false ) : array returns HAL-conform _links array.
processPut ( ApiEntity[] $entities, $requestEntities, callback $deleteCallback, callback $updateCallback, callback $addCallback, callback $entityIdCallback = null ) : boolean This method processes a put request (delete non-existing entities, update existing entities, add new entries), and let the single actions be modified by callbacks.
responseGetById ( $id, callback $findCallback ) : FOS\RestBundle\View\View Returns the response with the entity with the given id, or a response with a status of 404, in case the entity is not found. The find method is injected by a callback.
responseList ( array $where = [], string $entityName = null, Function $entityFilter = null, array $joinConditions = [] ) : Response Lists all the entities or filters the entities by parameters Special function for lists route /contacts/list.

Описание методов

addFieldAttributes() защищенный Метод

creates the translation keys array and sets the default attribute, if set also adds the type property for.
protected addFieldAttributes ( $fields, $fieldsHidden = [] ) : array
$fields
$fieldsHidden
Результат array

createHalResponse() защищенный Метод

creates HAL conform response-array out of an entity collection.
Устаревший:
protected createHalResponse ( array $entities, boolean $returnListLinks = false ) : array
$entities array
$returnListLinks boolean
Результат array

findMatch() защищенный Метод

Tries to find a given id in a given set of entities. Returns the entity itself and its key with the $matchedEntry and $matchKey parameters.
protected findMatch ( array $requestEntities, integer $id, array &$matchedEntry, string &$matchedKey )
$requestEntities array The set of entities to search in
$id integer The id to search
$matchedEntry array
$matchedKey string

getLocale() публичный Метод

Returns the language.
public getLocale ( Request $request ) : mixed
$request Symfony\Component\HttpFoundation\Request
Результат mixed

processPut() защищенный Метод

This method processes a put request (delete non-existing entities, update existing entities, add new entries), and let the single actions be modified by callbacks.
Устаревший:
protected processPut ( ApiEntity[] $entities, $requestEntities, callback $deleteCallback, callback $updateCallback, callback $addCallback, callback $entityIdCallback = null ) : boolean
$entities Sulu\Bundle\CoreBundle\Entity\ApiEntity[]
$requestEntities
$deleteCallback callback
$updateCallback callback
$addCallback callback
$entityIdCallback callback defines how to get the entity's id which will be compared with requestEntities' id
Результат boolean

replaceOrAddUrlString() публичный Метод

function replaces a url parameter.
Устаревший:
public replaceOrAddUrlString ( string $url, string $key, string $value, boolean $add = true ) : mixed | string
$url string String the complete url
$key string String parameter name (e.g. page=)
$value string replace value
$add boolean defines if value should be added
Результат mixed | string

responseDelete() публичный Метод

Deletes the entity with the given id using the deleteCallback and return a successful response, or an error message with a 4xx status code.
public responseDelete ( $id, $deleteCallback ) : FOS\RestBundle\View\View
$id
$deleteCallback
Результат FOS\RestBundle\View\View

responseFields() публичный Метод

Creates a response which contains all fields of the current entity.
Устаревший:
public responseFields ( ) : Response
Результат Symfony\Component\HttpFoundation\Response

responseGetById() защищенный Метод

Returns the response with the entity with the given id, or a response with a status of 404, in case the entity is not found. The find method is injected by a callback.
protected responseGetById ( $id, callback $findCallback ) : FOS\RestBundle\View\View
$id
$findCallback callback
Результат FOS\RestBundle\View\View

responseList() защищенный Метод

Lists all the entities or filters the entities by parameters Special function for lists route /contacts/list.
Устаревший:
protected responseList ( array $where = [], string $entityName = null, Function $entityFilter = null, array $joinConditions = [] ) : Response
$where array
$entityName string
$entityFilter Function function for filtering entities
$joinConditions array to specify join conditions
Результат Symfony\Component\HttpFoundation\Response

responsePersistSettings() публичный Метод

public responsePersistSettings ( ) : Response
Результат Symfony\Component\HttpFoundation\Response

Описание свойств

$bundlePrefix защищенное свойство

standard bundle prefix.
protected string $bundlePrefix
Результат string

$entityKey защищенное статическое свойство

The key of the entity which will be used in the embedded part of the REST Response.
protected static string $entityKey
Результат string

$entityName защищенное статическое свойство

The type of the entity, which is handled by the concrete controller.
protected static string $entityName
Результат string

$fieldTypes защищенное свойство

contains the matching between fields and their types.
protected array $fieldTypes
Результат array

$fieldsDefault защищенное свойство

contains fields that cannot be hidden and are visible by default.
protected array $fieldsDefault
Результат array

$fieldsEditable защищенное свойство

contains fields that are editable.
protected array $fieldsEditable
Результат array

$fieldsExcluded защищенное свойство

contains all fields that should be excluded from api.
Устаревший:
protected array $fieldsExcluded
Результат array

$fieldsHidden защищенное свойство

contains all fields that should be hidden by default from api.
protected array $fieldsHidden
Результат array

$fieldsMinWidth защищенное свойство

contains the widths of the fields
protected $fieldsMinWidth

$fieldsRelations защищенное свойство

contains all field relations.
Устаревший:
protected array $fieldsRelations
Результат array

$fieldsSortOrder защищенное свойство

contains sort order of elements: array(order => fieldName).
protected array $fieldsSortOrder
Результат array

$fieldsTranslationKeys защищенное свойство

contains custom translation keys like array(fieldName => translationKey).
Устаревший:
protected array $fieldsTranslationKeys
Результат array

$fieldsValidation защищенное свойство

contains arrays of validation key-value data.
protected array $fieldsValidation
Результат array

$fieldsWidth защищенное свойство

contains the widths of the fields
Устаревший:
protected $fieldsWidth

$sortable защищенное свойство

contains all attributes that are sortable if defined unsortable gets ignored.
protected array $sortable
Результат array

$unsortable защищенное свойство

contains all attributes that are not sortable.
protected array $unsortable
Результат array