PHP Class WoohooLabs\Yin\JsonApi\Request\Request

Inheritance: implements WoohooLabs\Yin\JsonApi\Request\RequestInterface
Show file Open project: woohoolabs/yin

Protected Properties

Property Type Description
$exceptionFactory WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface
$filtering array | null
$includedFields array | null
$includedRelationships array | null
$pagination array | null
$serverRequest Psr\Http\Message\ServerRequestInterface
$sorting array | null

Public Methods

Method Description
__construct ( Psr\Http\Message\ServerRequestInterface $request, WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface $exceptionFactory )
getAttribute ( $name, $default = null )
getAttributes ( )
getBody ( )
getCookieParams ( )
getCursorBasedPagination ( mixed $defaultCursor = null ) : CursorBasedPagination
getFiltering ( ) : array
getFilteringParam ( string $param, mixed $default = null ) : mixed
getFixedPageBasedPagination ( mixed $defaultPage = null ) : FixedPageBasedPagination
getHeader ( $name )
getHeaderLine ( $name )
getHeaders ( )
getIncludedFields ( string $resourceType ) : array
getIncludedRelationships ( string $baseRelationshipPath ) : array
getMethod ( )
getOffsetBasedPagination ( mixed $defaultOffset = null, mixed $defaultLimit = null ) : OffsetBasedPagination
getPageBasedPagination ( mixed $defaultPage = null, mixed $defaultSize = null ) : PageBasedPagination
getPagination ( ) : array
getParsedBody ( )
getProtocolVersion ( )
getQueryParam ( string $name, mixed $default = null ) : array | string | mixed
getQueryParams ( )
getRequestTarget ( )
getResource ( mixed $default = null ) : array | mixed
getResourceAttribute ( string $attribute, mixed $default = null ) : mixed
getResourceAttributes ( ) : array
getResourceId ( mixed $default = null ) : string | mixed
getResourceType ( mixed $default = null ) : string | mixed
getServerParams ( )
getSorting ( ) : array
getToManyRelationship ( string $relationship ) : ToManyRelationship | null
getToOneRelationship ( string $relationship ) : ToOneRelationship | null
getUploadedFiles ( )
getUri ( )
hasHeader ( $name )
hasIncludedRelationships ( ) : boolean
isIncludedField ( string $resourceType, string $field ) : boolean
isIncludedRelationship ( string $baseRelationshipPath, string $relationshipName, array $defaultRelationships ) : boolean
validateAcceptHeader ( )
validateContentTypeHeader ( )
validateQueryParams ( )
withAddedHeader ( $name, $value )
withAttribute ( $name, $value )
withBody ( Psr\Http\Message\StreamInterface $body )
withCookieParams ( array $cookies )
withHeader ( $name, $value )
withMethod ( $method )
withParsedBody ( $data )
withProtocolVersion ( $version )
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.
withQueryParams ( array $query )
withRequestTarget ( $requestTarget )
withUploadedFiles ( array $uploadedFiles )
withUri ( Psr\Http\Message\UriInterface $uri, $preserveHost = false )
withoutAttribute ( $name )
withoutHeader ( $name )

Protected Methods

Method Description
initializeParsedQueryParams ( )
isValidMediaTypeHeader ( string $headerName ) : boolean Returns a list of media type information, extracted from a given header in the current request.
setFiltering ( )
setIncludedFields ( )
setIncludedRelationships ( )
setPagination ( )
setSorting ( )

Method Details

__construct() public method

public __construct ( Psr\Http\Message\ServerRequestInterface $request, WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface $exceptionFactory )
$request Psr\Http\Message\ServerRequestInterface
$exceptionFactory WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface

getAttribute() public method

public getAttribute ( $name, $default = null )

getAttributes() public method

public getAttributes ( )

getBody() public method

public getBody ( )

getCookieParams() public method

public getCookieParams ( )

getCursorBasedPagination() public method

public getCursorBasedPagination ( mixed $defaultCursor = null ) : CursorBasedPagination
$defaultCursor mixed
return WoohooLabs\Yin\JsonApi\Request\Pagination\CursorBasedPagination

getFiltering() public method

public getFiltering ( ) : array
return array

getFilteringParam() public method

public getFilteringParam ( string $param, mixed $default = null ) : mixed
$param string
$default mixed
return mixed

getFixedPageBasedPagination() public method

public getFixedPageBasedPagination ( mixed $defaultPage = null ) : FixedPageBasedPagination
$defaultPage mixed
return WoohooLabs\Yin\JsonApi\Request\Pagination\FixedPageBasedPagination

getHeader() public method

public getHeader ( $name )

getHeaderLine() public method

public getHeaderLine ( $name )

getHeaders() public method

public getHeaders ( )

getIncludedFields() public method

public getIncludedFields ( string $resourceType ) : array
$resourceType string
return array

getIncludedRelationships() public method

public getIncludedRelationships ( string $baseRelationshipPath ) : array
$baseRelationshipPath string
return array

getMethod() public method

public getMethod ( )

getOffsetBasedPagination() public method

public getOffsetBasedPagination ( mixed $defaultOffset = null, mixed $defaultLimit = null ) : OffsetBasedPagination
$defaultOffset mixed
$defaultLimit mixed
return WoohooLabs\Yin\JsonApi\Request\Pagination\OffsetBasedPagination

getPageBasedPagination() public method

public getPageBasedPagination ( mixed $defaultPage = null, mixed $defaultSize = null ) : PageBasedPagination
$defaultPage mixed
$defaultSize mixed
return WoohooLabs\Yin\JsonApi\Request\Pagination\PageBasedPagination

getPagination() public method

public getPagination ( ) : array
return array

getParsedBody() public method

public getParsedBody ( )

getProtocolVersion() public method

public getProtocolVersion ( )

getQueryParam() public method

public getQueryParam ( string $name, mixed $default = null ) : array | string | mixed
$name string
$default mixed
return array | string | mixed

getQueryParams() public method

public getQueryParams ( )

getRequestTarget() public method

public getRequestTarget ( )

getResource() public method

public getResource ( mixed $default = null ) : array | mixed
$default mixed
return array | mixed

getResourceAttribute() public method

public getResourceAttribute ( string $attribute, mixed $default = null ) : mixed
$attribute string
$default mixed
return mixed

getResourceAttributes() public method

public getResourceAttributes ( ) : array
return array

getResourceId() public method

public getResourceId ( mixed $default = null ) : string | mixed
$default mixed
return string | mixed

getResourceType() public method

public getResourceType ( mixed $default = null ) : string | mixed
$default mixed
return string | mixed

getServerParams() public method

public getServerParams ( )

getSorting() public method

public getSorting ( ) : array
return array

getToManyRelationship() public method

public getToManyRelationship ( string $relationship ) : ToManyRelationship | null
$relationship string
return WoohooLabs\Yin\JsonApi\Hydrator\Relationship\ToManyRelationship | null

getToOneRelationship() public method

public getToOneRelationship ( string $relationship ) : ToOneRelationship | null
$relationship string
return WoohooLabs\Yin\JsonApi\Hydrator\Relationship\ToOneRelationship | null

getUploadedFiles() public method

public getUploadedFiles ( )

getUri() public method

public getUri ( )

hasHeader() public method

public hasHeader ( $name )

hasIncludedRelationships() public method

initializeParsedQueryParams() protected method

isIncludedField() public method

public isIncludedField ( string $resourceType, string $field ) : boolean
$resourceType string
$field string
return boolean

isIncludedRelationship() public method

public isIncludedRelationship ( string $baseRelationshipPath, string $relationshipName, array $defaultRelationships ) : boolean
$baseRelationshipPath string
$relationshipName string
$defaultRelationships array
return boolean

isValidMediaTypeHeader() protected method

Returns a list of media type information, extracted from a given header in the current request.
protected isValidMediaTypeHeader ( string $headerName ) : boolean
$headerName string
return boolean

setFiltering() protected method

protected setFiltering ( )

setIncludedFields() protected method

protected setIncludedFields ( )

setIncludedRelationships() protected method

protected setIncludedRelationships ( )

setPagination() protected method

protected setPagination ( )

setSorting() protected method

protected setSorting ( )

validateAcceptHeader() public method

validateContentTypeHeader() public method

validateQueryParams() public method

public validateQueryParams ( )

withAddedHeader() public method

public withAddedHeader ( $name, $value )

withAttribute() public method

public withAttribute ( $name, $value )

withBody() public method

public withBody ( Psr\Http\Message\StreamInterface $body )
$body Psr\Http\Message\StreamInterface

withCookieParams() public method

public withCookieParams ( array $cookies )
$cookies array

withHeader() public method

public withHeader ( $name, $value )

withMethod() public method

public withMethod ( $method )

withParsedBody() public method

public withParsedBody ( $data )

withProtocolVersion() public method

public withProtocolVersion ( $version )

withQueryParam() public method

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

withQueryParams() public method

public withQueryParams ( array $query )
$query array

withRequestTarget() public method

public withRequestTarget ( $requestTarget )

withUploadedFiles() public method

public withUploadedFiles ( array $uploadedFiles )
$uploadedFiles array

withUri() public method

public withUri ( Psr\Http\Message\UriInterface $uri, $preserveHost = false )
$uri Psr\Http\Message\UriInterface

withoutAttribute() public method

public withoutAttribute ( $name )

withoutHeader() public method

public withoutHeader ( $name )

Property Details

$exceptionFactory protected property

protected ExceptionFactoryInterface,WoohooLabs\Yin\JsonApi\Exception $exceptionFactory
return WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface

$filtering protected property

protected array|null $filtering
return array | null

$includedFields protected property

protected array|null $includedFields
return array | null

$includedRelationships protected property

protected array|null $includedRelationships
return array | null

$pagination protected property

protected array|null $pagination
return array | null

$serverRequest protected property

protected ServerRequestInterface,Psr\Http\Message $serverRequest
return Psr\Http\Message\ServerRequestInterface

$sorting protected property

protected array|null $sorting
return array | null