PHP Interface Tobscure\JsonApi\ElementInterface

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

Public Methods

Method Description
fields ( array | null $fields ) Request a restricted set of fields.
getResources ( ) : array Get the resources array.
toArray ( ) : array Map to a "resource object" array.
toIdentifier ( ) : array Map to a "resource object identifier" array.
with ( string | array $relationships ) Request a relationship to be included.

Method Details

fields() public method

Request a restricted set of fields.
public fields ( array | null $fields )
$fields array | null

getResources() public method

Get the resources array.
public getResources ( ) : array
return array

toArray() public method

Map to a "resource object" array.
public toArray ( ) : array
return array

toIdentifier() public method

Map to a "resource object identifier" array.
public toIdentifier ( ) : array
return array

with() public method

Request a relationship to be included.
public with ( string | array $relationships )
$relationships string | array