Collection
The class for LD collections.
Description #
Source #
File: src/Core/Collection.php
Changelog #
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |
Methods #
- __construct — Constructor.
- all — Get all items in the collection.
- count — Get the count of the items in the collection.
- current — Get the current object.
- fast_forward — Reset the iterator pointer to the end of the collection.
- filter — Filters the collection using the given callback.
- key — Get the key of the current item.
- merge — Merge the collection with the given items.
- next — Advance to the next object in the collection.
- offsetExists — Returns whether the offset exists in the collection.
- offsetGet — Get the item at the given offset.
- offsetSet — Sets the item at the given offset.
- offsetUnset — Unset the item at the given offset.
- push — Pushes one or more items onto the end of the collection.
- remove — Helper function for removing a resource from the collection.
- rewind — Reset the iterator pointer to the beginning of the collection.
- set — Sets a resource in the collection.
- valid — Gets whether the current position is valid.