__construct()
__construct(array $initArray = array())
Constructor method
Parameters
array | $initArray | An array of items to initialize the collection with. |
Create an iterable collection
key() : mixed|null
Get the current position of the pointer.
The key function simply returns the
key of the array element that's currently being pointed to by the internal pointer. It does not move the
pointer in any way. If the internal pointer points beyond the end of the elements list or the array is empty,
key returns null
.
getLast(string $strType = "") : mixed
Get last element in collection
string | $strType | Optional type to search for. For example, you can search the Collection for the
last Hidden element by doing: |
Returns last element in collection, null if collection is empty
merge(\ValidFormBuilder\Collection $collection)
Merge a collection with this collection.
\ValidFormBuilder\Collection | $collection | Collection to merge with |
rewind() : \ValidFormBuilder\Collection
Reset the internal pointer of the collection to the first item.
Returns itself after the internal pointer is reset.
reverse() : \ValidFormBuilder\Collection
Reverse the order of the collection and return it.
Returns itself after the internal collection is reversed.
removeRecursive(\ValidFormBuilder\Base $objElement)
Same as `remove()` but this is executed recursively.
\ValidFormBuilder\Base | $objElement |