SS_List
interface SS_List implements ArrayAccess, Countable, IteratorAggregate
An interface that a class can implement to be treated as a list container.
Methods
Returns all the items in the list in an array.
Returns the contents of the list as an array of maps.
Adds an item to the list, making no guarantees about where it will appear.
Removes an item from the list.
Returns the first item in the list.
Returns the last item in the list.
Returns a map of a key field to a value field of all the items in the list.
Returns the first item in the list where the key field is equal to the value.
Returns an array of a single field value for all items in the list.
Walks the list using the specified callback
Details
at line 15
array
toArray()
Returns all the items in the list in an array.
at line 22
array
toNestedArray()
Returns the contents of the list as an array of maps.
at line 30
add(mixed $item)
Adds an item to the list, making no guarantees about where it will appear.
at line 37
remove(mixed $item)
Removes an item from the list.
at line 44
mixed
first()
Returns the first item in the list.
at line 51
mixed
last()
Returns the last item in the list.
at line 61
array
map(string $keyfield = 'ID', string $titlefield = 'Title')
Returns a map of a key field to a value field of all the items in the list.
at line 71
mixed
find(string $key, mixed $value)
Returns the first item in the list where the key field is equal to the value.
at line 79
array
column(string $colName = "ID")
Returns an array of a single field value for all items in the list.
at line 87
mixed
each(callable $callback)
Walks the list using the specified callback