interface SS_List implements ArrayAccess, Countable, IteratorAggregate

An interface that a class can implement to be treated as a list container.

Methods

array
toArray()

Returns all the items in the list in an array.

array
toNestedArray()

Returns the contents of the list as an array of maps.

add(mixed $item)

Adds an item to the list, making no guarantees about where it will appear.

remove(mixed $item)

Removes an item from the list.

mixed
first()

Returns the first item in the list.

mixed
last()

Returns the last item in the list.

Map
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.

mixed
find(string $key, mixed $value)

Returns the first item in the list where the key field is equal to the value.

array
column(string $colName = "ID")

Returns an array of a single field value for all items in the list.

$this
each(callable $callback)

Walks the list using the specified callback

Details

at line 20
array toArray()

Returns all the items in the list in an array.

Return Value

array

at line 27
array toNestedArray()

Returns the contents of the list as an array of maps.

Return Value

array

at line 35
add(mixed $item)

Adds an item to the list, making no guarantees about where it will appear.

Parameters

mixed $item

at line 42
remove(mixed $item)

Removes an item from the list.

Parameters

mixed $item

at line 49
mixed first()

Returns the first item in the list.

Return Value

mixed

at line 56
mixed last()

Returns the last item in the list.

Return Value

mixed

at line 66
Map 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.

Parameters

string $keyfield
string $titlefield

Return Value

Map

at line 76
mixed find(string $key, mixed $value)

Returns the first item in the list where the key field is equal to the value.

Parameters

string $key
mixed $value

Return Value

mixed

at line 84
array column(string $colName = "ID")

Returns an array of a single field value for all items in the list.

Parameters

string $colName

Return Value

array

at line 92
$this each(callable $callback)

Walks the list using the specified callback

Parameters

callable $callback

Return Value

$this