PHP Class Tobscure\JsonApi\Parameters

Show file Open project: tobscure/json-api Class Usage Examples

Protected Properties

Property Type Description
$input array

Public Methods

Method Description
__construct ( array $input )
getFields ( ) : array Get the fields requested for inclusion.
getFilter ( ) : mixed Get a filter item.
getInclude ( array $available = [] ) : array Get the includes.
getLimit ( integer | null $max = null ) : integer | null Get the limit.
getOffset ( integer | null $perPage = null ) : integer Get number of offset.
getSort ( array $available = [] ) : array Get the sort.

Protected Methods

Method Description
getInput ( string $key, null $default = null ) : mixed Get an input item.
getOffsetFromNumber ( integer $perPage ) : integer Calculate the offset based on the page[number] parameter.
getPage ( string $key ) : string Get the page.

Method Details

__construct() public method

public __construct ( array $input )
$input array

getFields() public method

Get the fields requested for inclusion.
public getFields ( ) : array
return array

getFilter() public method

Get a filter item.
public getFilter ( ) : mixed
return mixed

getInclude() public method

Get the includes.
public getInclude ( array $available = [] ) : array
$available array
return array

getInput() protected method

Get an input item.
protected getInput ( string $key, null $default = null ) : mixed
$key string
$default null
return mixed

getLimit() public method

Get the limit.
public getLimit ( integer | null $max = null ) : integer | null
$max integer | null
return integer | null

getOffset() public method

Get number of offset.
public getOffset ( integer | null $perPage = null ) : integer
$perPage integer | null
return integer

getOffsetFromNumber() protected method

Calculate the offset based on the page[number] parameter.
protected getOffsetFromNumber ( integer $perPage ) : integer
$perPage integer
return integer

getPage() protected method

Get the page.
protected getPage ( string $key ) : string
$key string
return string

getSort() public method

Get the sort.
public getSort ( array $available = [] ) : array
$available array
return array

Property Details

$input protected property

protected array $input
return array