interface SS_List implements ArrayAccess, Countable, IteratorAggregate (View source)

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

Methods

public
T[]
toArray()

Returns all the items in the list in an array.

public
array
toNestedArray()

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

public
add(mixed $item)

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

public
remove(mixed $item)

Removes an item from the list.

public
T|null
first()

Returns the first item in the list.

public
T|null
last()

Returns the last item in the list.

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

public
T|null
find(string $key, mixed $value)

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

public
array
column(string $colName = "ID")

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

public
each($callback)

No description

Details

T[] toArray()

Returns all the items in the list in an array.

Return Value

T[]

array toNestedArray()

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

Return Value

array

add(mixed $item)

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

Parameters

mixed $item

remove(mixed $item)

Removes an item from the list.

Parameters

mixed $item

T|null first()

Returns the first item in the list.

Return Value

T|null

T|null last()

Returns the last item in the list.

Return Value

T|null

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

T|null 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

T|null

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

each($callback)

No description

Parameters

$callback