Свойство | 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 |
Méthode | 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 ) |
Méthode | 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 ( ) : |
||
Résultat |
protected convertRelationshipsToArray ( array $relationships ) : array | ||
$relationships | array | |
Résultat | array |
protected filterFields ( array $fields ) : array | ||
$fields | array | |
Résultat | array |
public getAttributes ( ) : array | ||
Résultat | array |
protected getOwnFields ( ) : array | null | ||
Résultat | array | null |
public getRelationships ( ) : |
||
Résultat |
public getRelationshipsAsArray ( ) : array | ||
Résultat | array |
public getSerializer ( ) : Tobscure\JsonApi\SerializerInterface | ||
Résultat | Tobscure\JsonApi\SerializerInterface |
public getUnfilteredRelationships ( ) : |
||
Résultat |
public isIdentifier ( ) : boolean | ||
Résultat | boolean |
protected mergeAttributes ( array $attributes ) : array | ||
$attributes | array | |
Résultat | array |
protected mergeRelationships ( array $relationships ) : array | ||
$relationships | array | |
Résultat | array |
public setSerializer ( Tobscure\JsonApi\SerializerInterface $serializer ) : void | ||
$serializer | Tobscure\JsonApi\SerializerInterface | |
Résultat | void |
protected array $includes | ||
Résultat | array |
protected Resource[],Tobscure\JsonApi $merged | ||
Résultat |