An ArrayCollection is a Collection implementation that wraps a regular PHP array.
@since 2.0 @author Guilherme Blanco <guilhermeblanco@hotmail.com> @author Jonathan Wage <jonwage@gmail.com> @author Roman Borschel <roman@code-factory.org>
Expanded class hierarchy of ArrayCollection
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ArrayCollection:: |
private | property | An array containing the entries of this collection. | |
ArrayCollection:: |
public | function |
Adds an element to the collection. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Clears the collection. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Checks whether the given element is contained in the collection.
Only element values are compared, not keys. The comparison of two elements
is strict, that means not only the value but also the type must match.
For objects this means reference equality. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Checks whether the collection contains a specific key/index. Overrides Collection:: |
|
ArrayCollection:: |
public | function | Returns the number of elements in the collection. | |
ArrayCollection:: |
public | function |
Gets the element of the collection at the current internal iterator position. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Tests for the existence of an element that satisfies the given predicate. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Returns all the elements of this collection that satisfy the predicate p.
The order of the elements is preserved. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Sets the internal iterator to the first element in the collection and
returns this element. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Applies the given predicate p to all elements of this collection,
returning true, if the predicate yields true for all elements. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Gets the element with the given key/index. Overrides Collection:: |
|
ArrayCollection:: |
public | function | Gets an iterator for iterating over the elements in the collection. | |
ArrayCollection:: |
public | function |
Gets all keys/indexes of the collection elements. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Gets all elements. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Searches for a given element and, if found, returns the corresponding key/index
of that element. The comparison of two elements is strict, that means not
only the value but also the type must match.
For objects this means reference equality. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Checks whether the collection is empty. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Gets the current key/index at the current internal iterator position. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Sets the internal iterator to the last element in the collection and
returns this element. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Applies the given function to each element in the collection and returns
a new collection with the elements returned by the function. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Select all elements from a selectable that match the criteria and
return a new collection containing these elements. Overrides Selectable:: |
|
ArrayCollection:: |
public | function |
Moves the internal iterator position to the next element. Overrides Collection:: |
|
ArrayCollection:: |
public | function | ArrayAccess implementation of offsetExists() | |
ArrayCollection:: |
public | function | ArrayAccess implementation of offsetGet() | |
ArrayCollection:: |
public | function | ArrayAccess implementation of offsetSet() | |
ArrayCollection:: |
public | function | ArrayAccess implementation of offsetUnset() | |
ArrayCollection:: |
public | function |
Partitions this collection in two collections according to a predicate.
Keys are preserved in the resulting collections. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Removes an element with a specific key/index from the collection. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Removes the specified element from the collection, if it is found. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Adds/sets an element in the collection at the index / with the specified key. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Extract a slice of $length elements starting at position $offset from the Collection. Overrides Collection:: |
|
ArrayCollection:: |
public | function |
Gets the PHP array representation of this collection. Overrides Collection:: |
|
ArrayCollection:: |
public | function | Initializes a new ArrayCollection. | |
ArrayCollection:: |
public | function | Returns a string representation of this object. |