Property | Type | Description | |
---|---|---|---|
$data | mixed | ||
$fields | array | null | A list of fields to restrict to. | |
$includes | array | A list of relationships to include. | |
$merged | An array of Resources that should be merged into this one. | ||
$serializer | Tobscure\JsonApi\SerializerInterface |
Method | Description | |
---|---|---|
__construct ( mixed $data, Tobscure\JsonApi\SerializerInterface $serializer ) | ||
fields ( $fields ) | ||
getAttributes ( ) : array | Get the resource attributes. | |
getData ( ) : mixed | ||
getId ( ) : string | Get the resource ID. | |
getRelationships ( ) : |
Get the resource relationships. | |
getRelationshipsAsArray ( ) : array | Get the resource relationships as an array. | |
getResources ( ) | ||
getSerializer ( ) : Tobscure\JsonApi\SerializerInterface | ||
getType ( ) : string | Get the resource type. | |
getUnfilteredRelationships ( ) : |
Get the resource relationships without considering requested ones. | |
isIdentifier ( ) : boolean | Check whether or not this resource is an identifier (i.e. does it have any data attached?). | |
merge ( |
Merge a resource into this one. | |
setData ( mixed $data ) : void | ||
setSerializer ( Tobscure\JsonApi\SerializerInterface $serializer ) : void | ||
toArray ( ) | ||
toIdentifier ( ) | ||
with ( $relationships ) |
Method | Description | |
---|---|---|
buildRelationships ( ) : |
Get an array of built relationships. | |
convertRelationshipsToArray ( array $relationships ) : array | Convert the given array of Relationship objects into an array. | |
filterFields ( array $fields ) : array | Filter the given fields array (attributes or relationships) according to the requested fieldset. | |
getOwnFields ( ) : array | null | Get the requested fields for this resource type. | |
mergeAttributes ( array $attributes ) : array | Merge the attributes of merged resources into an array of attributes. | |
mergeRelationships ( array $relationships ) : array | Merge the relationships of merged resources into an array of relationships. |
public __construct ( mixed $data, Tobscure\JsonApi\SerializerInterface $serializer ) | ||
$data | mixed | |
$serializer | Tobscure\JsonApi\SerializerInterface |
protected buildRelationships ( ) : |
||
return |
protected convertRelationshipsToArray ( array $relationships ) : array | ||
$relationships | array | |
return | array |
protected filterFields ( array $fields ) : array | ||
$fields | array | |
return | array |
public getAttributes ( ) : array | ||
return | array |
protected getOwnFields ( ) : array | null | ||
return | array | null |
public getRelationships ( ) : |
||
return |
public getRelationshipsAsArray ( ) : array | ||
return | array |
public getSerializer ( ) : Tobscure\JsonApi\SerializerInterface | ||
return | Tobscure\JsonApi\SerializerInterface |
public getUnfilteredRelationships ( ) : |
||
return |
public isIdentifier ( ) : boolean | ||
return | boolean |
protected mergeAttributes ( array $attributes ) : array | ||
$attributes | array | |
return | array |
protected mergeRelationships ( array $relationships ) : array | ||
$relationships | array | |
return | array |
public setSerializer ( Tobscure\JsonApi\SerializerInterface $serializer ) : void | ||
$serializer | Tobscure\JsonApi\SerializerInterface | |
return | void |
protected array $includes | ||
return | array |
protected Resource[],Tobscure\JsonApi $merged | ||
return |