NullIncludedData
class NullIncludedData extends IncludedData (View source)
| internal | JSON:API maintains no PHP API. The API is the HTTP API. This class may change at any time and could break any dependencies on it. |
Use when there are no included resources but a Data object is required.
Properties
| protected ResourceIdentifierInterface[] | $data | Various representations of JSON:API objects. |
from Data |
| protected int | $cardinality | The number of resources permitted in this collection. |
from Data |
| protected bool | $hasNextPage | Holds a boolean indicating if there is a next page. |
from Data |
| protected int | $count | Holds the total count of entities. |
from Data |
Methods
NullData constructor.
Returns the data for the top-level data member of a JSON:API document.
Merges the object's meta member with the top-level meta member.
Details
__construct()
NullData constructor.
in
Data at line 72
ArrayIterator
getIterator()
Returns an iterator for entities.
in
Data at line 83
int
count()
Returns the number of entities.
in
Data at line 91
getTotalCount()
{@inheritdoc}
in
Data at line 98
setTotalCount($count)
{@inheritdoc}
in
Data at line 108
EntityInterface[]
toArray()
Returns the collection as an array.
in
Data at line 118
bool
hasNextPage()
Checks if there is a next page in the collection.
in
Data at line 131
setHasNextPage(bool $has_next_page)
Sets the has next page flag.
Once the collection query has been executed and we build the entity collection, we now if there will be a next page with extra entities.
in
Data at line 141
int
getCardinality()
Gets the cardinality of this collection.
in
Data at line 156
static Data
merge(Data $a, Data $b)
Returns a new Data object containing the entities of $this and $other.
in
Data at line 169
static Data
deduplicate(Data $collection)
Returns a new, deduplicated Data object.
Data
getData()
Returns the data for the top-level data member of a JSON:API document.
ResourceObjectData
getAccessible()
Gets only data to be exposed.
OmittedData
getOmissions()
Gets only data to be omitted.
LinkCollection
getMergedLinks(LinkCollection $top_level_links)
Merges the object's links with the top-level links.
array
getMergedMeta(array $top_level_meta)
Merges the object's meta member with the top-level meta member.