Map
class Map implements ArrayAccess, Countable, IteratorAggregate
Creates a map from an SS_List by defining a key column and a value column.
Methods
Construct a new map around an SS_list.
Set the key field for this map.
Set the value field for this map.
Return an array equivalent to this map.
Return all the keys of this map.
Return all the values of this map.
Unshift an item onto the start of the map.
Pushes an item onto the end of the map.
No description
No description
Sets a value in the map by a given key that has been set via {@link Map::push()} or {@link Map::unshift()}
Removes a value in the map by a given key which has been added to the map via {@link Map::push()} or {@link Map::unshift()}
Returns an Map_Iterator instance for iterating over the complete set of items in the map.
Returns the count of items in the list including the additional items set through {@link Map::push()} and {@link Map::unshift}.
Details
at line 38
__construct(SS_List $list, string $keyField = "ID", string $valueField = "Title")
Construct a new map around an SS_list.
at line 50
setKeyField($keyField)
Set the key field for this map.
at line 60
setValueField($valueField)
Set the value field for this map.
at line 70
array
toArray()
Return an array equivalent to this map.
at line 86
array
keys()
Return all the keys of this map.
at line 96
array
values()
Return all the values of this map.
at line 110
$this
unshift($key, $value)
Unshift an item onto the start of the map.
Stores the value in addition to the {@link DataQuery} for the map.
at line 131
$this
push($key, $value)
Pushes an item onto the end of the map.
at line 153
boolean
offsetExists($key)
at line 173
mixed
offsetGet($key)
at line 205
offsetSet($key, $value)
Sets a value in the map by a given key that has been set via {@link Map::push()} or {@link Map::unshift()}
Keys in the map cannot be set since these values are derived from a {@link DataQuery} instance. In this case, use {@link Map::toArray()} and manipulate the resulting array.
at line 232
offsetUnset($key)
Removes a value in the map by a given key which has been added to the map via {@link Map::push()} or {@link Map::unshift()}
Keys in the map cannot be unset since these values are derived from a {@link DataQuery} instance. In this case, use {@link Map::toArray()} and manipulate the resulting array.
at line 260
Map_Iterator
getIterator()
Returns an Map_Iterator instance for iterating over the complete set of items in the map.
Satisfies the IteratorAggreagte interface.
at line 312
int
count()
Returns the count of items in the list including the additional items set through {@link Map::push()} and {@link Map::unshift}.