PersistentRelatedEntitiesCollection
class PersistentRelatedEntitiesCollection implements Collection, Selectable
Collection for persistent related entities.
We do not support all of Doctrine's built-in features.
Methods
Gets the PHP array representation of this collection.
Sets the internal iterator to the first element in the collection and returns this element.
Sets the internal iterator to the last element in the collection and returns this element.
Gets the current key/index at the current internal iterator position.
Moves the internal iterator position to the next element.
Gets the element of the collection at the current internal iterator position.
Removes an element with a specific key/index from the collection.
Removes the specified element from the collection, if it is found.
ArrayAccess implementation of offsetExists()
ArrayAccess implementation of offsetGet()
ArrayAccess implementation of offsetSet()
ArrayAccess implementation of offsetUnset()
Checks whether the collection contains a specific key/index.
Checks whether the given element is contained in the collection.
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.
Gets the element with the given key/index.
Gets all keys/indexes of the collection elements.
Gets all elements.
Returns the number of elements in the collection.
Adds/sets an element in the collection at the index / with the specified key.
Adds an element to the collection.
Checks whether the collection is empty.
Gets an iterator for iterating over the elements in the collection.
Returns a string representation of this object.
Clears the collection.
Extract a slice of $length elements starting at position $offset from the Collection.
Select all elements from a selectable that match the criteria and return a new collection containing these elements.
Details
at line 28
__construct(Registry $registry, Job $job)
at line 39
array
toArray()
Gets the PHP array representation of this collection.
at line 52
object|false
first()
Sets the internal iterator to the first element in the collection and returns this element.
at line 65
object|false
last()
Sets the internal iterator to the last element in the collection and returns this element.
at line 77
string|integer
key()
Gets the current key/index at the current internal iterator position.
at line 89
object|false
next()
Moves the internal iterator position to the next element.
at line 101
object|false
current()
Gets the element of the collection at the current internal iterator position.
at line 114
object|null
remove(string|integer $key)
Removes an element with a specific key/index from the collection.
at line 125
boolean
removeElement(object $element)
Removes the specified element from the collection, if it is found.
at line 138
bool
offsetExists(mixed $offset)
ArrayAccess implementation of offsetExists()
at line 153
mixed
offsetGet(mixed $offset)
ArrayAccess implementation of offsetGet()
at line 170
bool
offsetSet(mixed $offset, mixed $value)
ArrayAccess implementation of offsetSet()
at line 183
mixed
offsetUnset(mixed $offset)
ArrayAccess implementation of offsetUnset()
at line 194
boolean
containsKey(mixed $key)
Checks whether the collection contains a specific key/index.
at line 211
boolean
contains(mixed $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.
at line 230
boolean
exists(Closure $p)
Tests for the existence of an element that satisfies the given predicate.
at line 251
mixed
indexOf(mixed $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.
at line 264
mixed
get(mixed $key)
Gets the element with the given key/index.
at line 279
array
getKeys()
Gets all keys/indexes of the collection elements.
at line 291
array
getValues()
Gets all elements.
at line 305
integer
count()
Returns the number of elements in the collection.
Implementation of the Countable interface.
at line 321
set(mixed $key, mixed $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).
at line 332
boolean
add(mixed $value)
Adds an element to the collection.
at line 344
boolean
isEmpty()
Checks whether the collection is empty.
Note: This is preferable over count() == 0.
at line 356
ArrayIterator
getIterator()
Gets an iterator for iterating over the elements in the collection.
at line 370
Collection
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.
at line 384
Collection
filter(Closure $p)
Returns all the elements of this collection that satisfy the predicate p.
The order of the elements is preserved.
at line 398
boolean
forAll(Closure $p)
Applies the given predicate p to all elements of this collection, returning true, if the predicate yields true for all elements.
at line 420
array
partition(Closure $p)
Partitions this collection in two collections according to a predicate.
Keys are preserved in the resulting collections.
at line 440
string
__toString()
Returns a string representation of this object.
at line 448
clear()
Clears the collection.
at line 464
array
slice(int $offset, int $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.
at line 478
Collection
matching(Criteria $criteria)
Select all elements from a selectable that match the criteria and return a new collection containing these elements.