Nayjest\Collection\CollectionReadInterface
CollectionReadInterface describes methods of immutable collection.
Synopsis
interface CollectionReadInterface
extends IteratorAggregate, Countable
{
- // methods
- public array toArray()
- public bool isEmpty()
- public mixed|null first()
- public bool contains()
- public CollectionReadInterface|static filter()
- public mixed|FALSE find()
- public CollectionReadInterface|static map()
- public CollectionReadInterface|static sort()
- public mixed|null random()
- public CollectionReadInterface|static beforeItem()
- public CollectionReadInterface|static afterItem()
- public bool isWritable()
Hierarchy
Extends
Methods
public
- afterItem()
- beforeItem()
- contains() — Checks that collections contains target item.
- filter() — Iterates over each value in the <b>collection</b> passing them to the <b>callback</b> function.
- find() — Iterates over each value in the <b>collection</b> passing them to the <b>callback</b> function.
- first() — Returns first item of the collection or null if collection is empty.
- isEmpty() — Returns true if collection is empty.
- isWritable() — Returns true if collection implements CollectionWriteInterface.
- map()
- random() — Returns random collection element or NULL for empty collection.
- sort()
- toArray() — Returns collection items in array.