-
Appends one or more elements to the end of the collection, via the PHP function array_push.
-
A synonym for the WOOF_Collection::sort method, to sort the collection by the value of a property specified. A “property” here can be a genuine object property, or the result of a method call as handled by the WOOF_Wrap::get method. .
-
A synonym for the WOOF_Collection::sort method, to sort the collection by the value of a property specified, preset to a forced numeric sort. A “property” here can be a genuine object property, or the result of a method call as handled by the WOOF_Wrap::get method. .
-
An alias for the WOOF_Collection::item method to add ‘class=”first”‘ or ‘class=”last”‘ (or other classes as specified in $args) to HTML tags as you loop through the collection, without needing to track this yourself.
-
Checks if the collection contains the specified value for the specified property. .
-
Retrieves the number of items in the collection.
-
Formats the count of items in the collection based on string templates for the cases of one item, many items, or zero items.
-
A preset of the WOOF_Collection::flatten method to generate a comma separated values list of the values in the given property.
-
Implements the PHP iterator interface’s current method, to facilitate iteration over the collection.Note: this method is not intended to be called directly.
-
Removes duplicates from the collection as identified by the specified property, that is, two objects are considered duplicate if the property value on each of those objects is the same.
-
Retrieves the item at the specified index.
-
Finds the first item in the collection for a given property and value.
-
Finds all items in the collection for a given property and one or more values.
-
Retrieve the first item in the collection, a collection of the first $count items in the collection, or an object for silent failure if the collection contains no items.
-
flatten( String $name, Arguments $args = array(), String $remove_call_args = separator,prefix,suffix )String
Flattens the collection to a string made up of a given single property value from each separated by a given separator. .
-
A synonym for the WOOF_Collection::eq method, to retrieve the item at the specified index.
-
Returns the index of the given item, searching each object in the collection for a given value from the specified property .
-
An internal method that primes the items in the collection based on calling the iterator_items method, if the items are not already available.
-
Checks if this collection is empty, that is, contains no items.
-
A synonym for the WOOF_Collection::eq method, to retrieve the item at the specified index.
-
A useful method to add ‘class=”first”‘ or ‘class=”last”‘ (or other classes as specified in $args) to HTML tags as you loop through the collection, without needing to track this yourself.
-
A dual purpose method to either return an array of all of the items in the collection, or return an item at the specified index (essentially forwards on to the WOOF_Collection::eq method).
-
Implements the PHP iterator interface’s key method, to facilitate iteration over the collection.Note: this method is not intended to be called directly.
-
Retrieve the final item in the collection, a collection of the final $count items in the collection, or an object for silent failure if the collection contains no items.
-
Merges another collection or array into this collection, using PHP’s array_merge function. .
-
Implements the PHP iterator interface’s next method, to facilitate iteration over the collection.Note: this method is not intended to be called directly.
-
A normalised version of the WOOF_Collection::eq method to return an item from the collection at a specific index, while assuming that all access is 1-based – that is, index 1 is the first element, not 0. This method also supports negative indexes, which will retrieve the nth-item backwards from the end of the collection (so -1 is the final item, -2 is the second last item, and so on).The name of this method “number” is intended to make code using it more readable, since it makes sense to refer to, say, the second item as item “number 2”.
-
Implements the offsetExists method from PHP’s ArrayAccess interface, to allow the isset function to be called on a numeric array access on this collection (see example). Note: this method is not intended to be called directly.
-
Implements the offsetGet method from PHP’s ArrayAccess interface, to allow a direct numeric array access on this collection (see example).
-
Implements the offsetSet method from PHP’s ArrayAccess interface, to allow an item at a specific index to be set via numeric array access on this collection (see example). Note: this method is not intended to be called directly.
-
Implements the offsetUnset method from PHP’s ArrayAccess interface, to allow the unset function to be called on a numeric array access on this collection (see example). Note: this method is not intended to be called directly.
-
Returns a collection of the items in the collection sorted by the values for the given property.
-
Prepends one or more elements to the start of the collection, via the PHP function array_unshift.
-
A synonym for the WOOF_Collection::append method, which appends one or more elements to the end of the collection, via the PHP function array_push.
-
Returns a collection representing a slice of the field set items in the collection starting at the from index supplied, and ending at the to index supplied.Note: the from and to indexes are zero-based. .
-
Reverses the items in the collection.
-
Implements the PHP iterator interface’s rewind method, to facilitate iteration over the collection.Note: this method is not intended to be called directly.
-
Returns a collection of the items in the collection sorted by the values for the given property. A “property” here can be a genuine object property, or the result of a method call as handled by the WOOF_Wrap::get method. .
-
Returns a collection of the items in this collection sorted by the given field in the order of a supplied values map.
-
Wraps a given property from each of the items in the collection in the specified HTML tag with the given attributes.
-
A synonym for the WOOF_Collection::prepend method, to prepend one or more elements to the start of the collection, via the PHP function array_unshift.
-
Implements the PHP iterator interface’s valid method, to facilitate iteration over the collection.Note: this method is not intended to be called directly.