PHP 인터페이스 WoohooLabs\Yin\JsonApi\Request\RequestInterface

상속: extends Psr\Http\Message\ServerRequestInterface
파일 보기 프로젝트 열기: woohoolabs/yin 0 사용 예제들

공개 메소드들

메소드 설명
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.

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