MIOLO20
|
Membros públicos | |
__construct (array $elements=array()) | |
toArray () | |
first () | |
last () | |
key () | |
next () | |
current () | |
remove ($key) | |
removeElement ($element) | |
offsetExists ($offset) | |
offsetGet ($offset) | |
offsetSet ($offset, $value) | |
offsetUnset ($offset) | |
containsKey ($key) | |
contains ($element) | |
exists (Closure $p) | |
indexOf ($element) | |
get ($key) | |
getKeys () | |
getValues () | |
count () | |
set ($key, $value) | |
add ($value) | |
isEmpty () | |
getIterator () | |
map (Closure $func) | |
filter (Closure $p) | |
forAll (Closure $p) | |
partition (Closure $p) | |
__toString () | |
clear () | |
slice ($offset, $length=null) | |
An ArrayCollection is a Collection implementation that wraps a regular PHP array.
Definido na linha 32 do ficheiro ArrayCollection.php.
__construct | ( | array | $elements = array() | ) |
Initializes a new ArrayCollection.
array | $elements |
Definido na linha 46 do ficheiro ArrayCollection.php.
__toString | ( | ) |
Returns a string representation of this object.
Definido na linha 410 do ficheiro ArrayCollection.php.
add | ( | $value | ) |
Adds an element to the collection.
mixed | $value |
Implementa Collection.
Definido na linha 313 do ficheiro ArrayCollection.php.
clear | ( | ) |
Clears the collection.
Implementa Collection.
Definido na linha 418 do ficheiro ArrayCollection.php.
contains | ( | $element | ) |
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.
mixed | $element |
Implementa Collection.
Definido na linha 215 do ficheiro ArrayCollection.php.
containsKey | ( | $key | ) |
Checks whether the collection contains a specific key/index.
mixed | $key | The key to check for. |
Implementa Collection.
Definido na linha 200 do ficheiro ArrayCollection.php.
count | ( | ) |
Returns the number of elements in the collection.
Implementation of the Countable interface.
Definido na linha 288 do ficheiro ArrayCollection.php.
current | ( | ) |
Gets the element of the collection at the current internal iterator position.
Implementa Collection.
Definido na linha 108 do ficheiro ArrayCollection.php.
exists | ( | Closure | $p | ) |
Tests for the existance of an element that satisfies the given predicate.
Closure | $p | The predicate. |
Implementa Collection.
Definido na linha 226 do ficheiro ArrayCollection.php.
filter | ( | Closure | $p | ) |
Returns all the elements of this collection that satisfy the predicate p. The order of the elements is preserved.
Closure | $p | The predicate used for filtering. |
Implementa Collection.
Definido na linha 360 do ficheiro ArrayCollection.php.
first | ( | ) |
Sets the internal iterator to the first element in the collection and returns this element.
Implementa Collection.
Definido na linha 67 do ficheiro ArrayCollection.php.
forAll | ( | Closure | $p | ) |
Applies the given predicate p to all elements of this collection, returning true, if the predicate yields true for all elements.
Closure | $p | The predicate. |
Implementa Collection.
Definido na linha 372 do ficheiro ArrayCollection.php.
get | ( | $key | ) |
Gets the element with the given key/index.
mixed | $key | The key. |
Implementa Collection.
Definido na linha 253 do ficheiro ArrayCollection.php.
getIterator | ( | ) |
Gets an iterator for iterating over the elements in the collection.
Definido na linha 336 do ficheiro ArrayCollection.php.
getKeys | ( | ) |
Gets all keys/indexes of the collection elements.
Implementa Collection.
Definido na linha 266 do ficheiro ArrayCollection.php.
getValues | ( | ) |
Gets all elements.
Implementa Collection.
Definido na linha 276 do ficheiro ArrayCollection.php.
indexOf | ( | $element | ) |
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.
mixed | $element | The element to search for. |
Implementa Collection.
Definido na linha 242 do ficheiro ArrayCollection.php.
isEmpty | ( | ) |
Checks whether the collection is empty.
Note: This is preferrable over count() == 0.
Implementa Collection.
Definido na linha 326 do ficheiro ArrayCollection.php.
key | ( | ) |
Gets the current key/index at the current internal iterator position.
Implementa Collection.
Definido na linha 88 do ficheiro ArrayCollection.php.
last | ( | ) |
Sets the internal iterator to the last element in the collection and returns this element.
Implementa Collection.
Definido na linha 78 do ficheiro ArrayCollection.php.
map | ( | Closure | $func | ) |
Applies the given function to each element in the collection and returns a new collection with the elements returned by the function.
Closure | $func |
Implementa Collection.
Definido na linha 348 do ficheiro ArrayCollection.php.
next | ( | ) |
Moves the internal iterator position to the next element.
Implementa Collection.
Definido na linha 98 do ficheiro ArrayCollection.php.
offsetExists | ( | $offset | ) |
ArrayAccess implementation of offsetExists()
Definido na linha 155 do ficheiro ArrayCollection.php.
offsetGet | ( | $offset | ) |
ArrayAccess implementation of offsetGet()
Definido na linha 165 do ficheiro ArrayCollection.php.
offsetSet | ( | $offset, | |
$value ) |
ArrayAccess implementation of offsetGet()
Definido na linha 176 do ficheiro ArrayCollection.php.
offsetUnset | ( | $offset | ) |
ArrayAccess implementation of offsetUnset()
Definido na linha 189 do ficheiro ArrayCollection.php.
partition | ( | Closure | $p | ) |
Partitions this collection in two collections according to a predicate. Keys are preserved in the resulting collections.
Closure | $p | The predicate on which to partition. |
Implementa Collection.
Definido na linha 392 do ficheiro ArrayCollection.php.
remove | ( | $key | ) |
Removes an element with a specific key/index from the collection.
mixed | $key |
Implementa Collection.
Definido na linha 119 do ficheiro ArrayCollection.php.
removeElement | ( | $element | ) |
Removes the specified element from the collection, if it is found.
mixed | $element | The element to remove. |
Implementa Collection.
Definido na linha 137 do ficheiro ArrayCollection.php.
set | ( | $key, | |
$value ) |
Adds/sets an element in the collection at the index / with the specified key.
When the collection is a Map this is like put(key,value)/add(key,value). When the collection is a List this is like add(position,value).
mixed | $key | |
mixed | $value |
Implementa Collection.
Definido na linha 302 do ficheiro ArrayCollection.php.
slice | ( | $offset, | |
$length = null ) |
Extract a slice of $length elements starting at position $offset from the Collection.
If $length is null it returns all elements from $offset to the end of the Collection. Keys have to be preserved by this method. Calling this method will only return the selected slice and NOT change the elements contained in the collection slice is called on.
int | $offset | |
int | $length |
Implementa Collection.
Definido na linha 434 do ficheiro ArrayCollection.php.
toArray | ( | ) |
Gets the PHP array representation of this collection.
Implementa Collection.
Definido na linha 56 do ficheiro ArrayCollection.php.