PHP 클래스 Sulu\Component\Rest\RestController

상속: extends FOS\RestBundle\Controller\FOSRestController
파일 보기 프로젝트 열기: sulu/sulu

보호된 프로퍼티들

프로퍼티 타입 설명
$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