PHP Интерфейс WoohooLabs\Yin\JsonApi\Request\RequestInterface

Наследование: extends Psr\Http\Message\ServerRequestInterface
Показать файл Открыть проект Примеры использования интерфейса

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

Метод Описание
getCursorBasedPagination ( mixed $defaultCursor = null ) : CursorBasedPagination
getFiltering ( ) : array
getFilteringParam ( string $param, mixed | null $default = null ) : array | string
getFixedPageBasedPagination ( mixed $defaultPage = null ) : FixedPageBasedPagination
getIncludedFields ( string $resourceType ) : array Returns a list of field names for the given resource type which are required to be present in the response.
getIncludedRelationships ( string $baseRelationshipPath ) : array Returns a list of relationship paths for a given parent path.
getOffsetBasedPagination ( mixed $defaultOffset = null, mixed $defaultLimit = null ) : OffsetBasedPagination
getPageBasedPagination ( mixed $defaultPage = null, mixed $defaultSize = null ) : PageBasedPagination
getPagination ( ) : array | null
getQueryParam ( string $name, mixed $default = null ) : array | string Returns a query parameter with a name of $name if it is present in the request, or the $default value otherwise.
getResource ( ) : array | null Returns the "data" part of the request if it is present in the body, or null otherwise.
getResourceAttribute ( string $attribute, mixed | null $default = null ) : mixed | null
getResourceAttributes ( ) : array
getResourceId ( ) : string | null Returns the "id" key's value in the "data" part of the request if it is present in the body, or null otherwise.
getResourceType ( ) : string | null Returns the "type" key's value in the "data" part of the request if it is present in the body, or null otherwise.
getSorting ( ) : array
getToManyRelationship ( string $relationship ) : ToManyRelationship | null
getToOneRelationship ( string $relationship ) : ToOneRelationship | null
hasIncludedRelationships ( ) : boolean Determines if the request needs any relationships to be included.
isIncludedField ( string $resourceType, string $field ) : boolean Determines if a given field for a given resource type should be present in the response or not.
isIncludedRelationship ( string $baseRelationshipPath, string $relationshipName, array $defaultRelationships ) : boolean Determines if a given relationship name that is a child of the $baseRelationshipPath is required to be included in the response.
validateAcceptHeader ( ) Validates if the current request's Accept header conforms to the JSON API schema.
validateContentTypeHeader ( ) Validates if the current request's Content-Type header conforms to the JSON API schema.
validateQueryParams ( ) Validates if the current request's query parameters conform to the JSON API schema.
withQueryParam ( string $name, mixed $value ) Returns a query parameter with a name of $name if it is present in the request, or the $default value otherwise.

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

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

public getCursorBasedPagination ( mixed $defaultCursor = null ) : CursorBasedPagination
$defaultCursor mixed
Результат WoohooLabs\Yin\JsonApi\Request\Pagination\CursorBasedPagination

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

public getFiltering ( ) : array
Результат array

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

public getFilteringParam ( string $param, mixed | null $default = null ) : array | string
$param string
$default mixed | null
Результат array | string

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

public getFixedPageBasedPagination ( mixed $defaultPage = null ) : FixedPageBasedPagination
$defaultPage mixed
Результат WoohooLabs\Yin\JsonApi\Request\Pagination\FixedPageBasedPagination

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

Returns a list of field names for the given resource type which are required to be present in the response.
public getIncludedFields ( string $resourceType ) : array
$resourceType string
Результат array

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

Returns a list of relationship paths for a given parent path.
public getIncludedRelationships ( string $baseRelationshipPath ) : array
$baseRelationshipPath string
Результат array

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

public getOffsetBasedPagination ( mixed $defaultOffset = null, mixed $defaultLimit = null ) : OffsetBasedPagination
$defaultOffset mixed
$defaultLimit mixed
Результат WoohooLabs\Yin\JsonApi\Request\Pagination\OffsetBasedPagination

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

public getPageBasedPagination ( mixed $defaultPage = null, mixed $defaultSize = null ) : PageBasedPagination
$defaultPage mixed
$defaultSize mixed
Результат WoohooLabs\Yin\JsonApi\Request\Pagination\PageBasedPagination

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

public getPagination ( ) : array | null
Результат array | null

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

Returns a query parameter with a name of $name if it is present in the request, or the $default value otherwise.
public getQueryParam ( string $name, mixed $default = null ) : array | string
$name string
$default mixed
Результат array | string

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

Returns the "data" part of the request if it is present in the body, or null otherwise.
public getResource ( ) : array | null
Результат array | null

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

public getResourceAttribute ( string $attribute, mixed | null $default = null ) : mixed | null
$attribute string
$default mixed | null
Результат mixed | null

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

public getResourceAttributes ( ) : array
Результат array

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

Returns the "id" key's value in the "data" part of the request if it is present in the body, or null otherwise.
public getResourceId ( ) : string | null
Результат string | null

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

Returns the "type" key's value in the "data" part of the request if it is present in the body, or null otherwise.
public getResourceType ( ) : string | null
Результат string | null

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

public getSorting ( ) : array
Результат array

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

public getToManyRelationship ( string $relationship ) : ToManyRelationship | null
$relationship string
Результат WoohooLabs\Yin\JsonApi\Hydrator\Relationship\ToManyRelationship | null

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

public getToOneRelationship ( string $relationship ) : ToOneRelationship | null
$relationship string
Результат WoohooLabs\Yin\JsonApi\Hydrator\Relationship\ToOneRelationship | null

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

Determines if the request needs any relationships to be included.
public hasIncludedRelationships ( ) : boolean
Результат boolean

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

Determines if a given field for a given resource type should be present in the response or not.
public isIncludedField ( string $resourceType, string $field ) : boolean
$resourceType string
$field string
Результат boolean

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

Determines if a given relationship name that is a child of the $baseRelationshipPath is required to be included in the response.
public isIncludedRelationship ( string $baseRelationshipPath, string $relationshipName, array $defaultRelationships ) : boolean
$baseRelationshipPath string
$relationshipName string
$defaultRelationships array
Результат boolean

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

Validates if the current request's Accept header conforms to the JSON API schema.

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

Validates if the current request's Content-Type header conforms to the JSON API schema.

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

According to the JSON API specification "Implementation specific query parameters MUST adhere to the same constraints as member names with the additional requirement that they MUST contain at least one non a-z character (U+0061 to U+007A)".
public validateQueryParams ( )

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

Returns a query parameter with a name of $name if it is present in the request, or the $default value otherwise.
public withQueryParam ( string $name, mixed $value )
$name string
$value mixed