SS_Map
class SS_Map implements ArrayAccess, Countable, IteratorAggregate (View source)
Creates a map from an SS_List by defining a key column and a value column.
Properties
protected | $list | |||
protected | $keyField | |||
protected | $valueField | |||
protected | array | $firstItems | ||
protected | array | $lastItems |
Methods
Construct a new map around an SS_list.
Sets a value in the map by a given key that has been set via SS_Map::push()} or {@link SS_Map::unshift()
Removes a value in the map by a given key which has been added to the map via SS_Map::push()} or {@link SS_Map::unshift()
Returns an SS_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 SS_Map::push()} and {@link SS_Map::unshift.
Details
__construct(SS_List $list, $keyField = "ID", $valueField = "Title")
Construct a new map around an SS_list.
setKeyField($keyField)
Set the key field for this map.
setValueField($valueField)
Set the value field for this map.
array
toArray()
Return an array equivalent to this map.
array
keys()
Return all the keys of this map.
array
values()
Return all the values of this map.
unshift($key, $value)
Unshift an item onto the start of the map.
Stores the value in addition to the DataQuery for the map.
push($key, $value)
Pushes an item onto the end of the map.
bool
offsetExists($key)
No description
mixed
offsetGet($key)
No description
offsetSet($key, $value)
Sets a value in the map by a given key that has been set via SS_Map::push()} or {@link SS_Map::unshift()
Keys in the map cannot be set since these values are derived from a DataQuery} instance. In this case, use {@link SS_Map::toArray() and manipulate the resulting array.
offsetUnset($key)
Removes a value in the map by a given key which has been added to the map via SS_Map::push()} or {@link SS_Map::unshift()
Keys in the map cannot be unset since these values are derived from a DataQuery} instance. In this case, use {@link SS_Map::toArray() and manipulate the resulting array.
SS_Map_Iterator
getIterator()
Returns an SS_Map_Iterator instance for iterating over the complete set of items in the map.
Satisfies the IteratorAggreagte interface.
int
count()
Returns the count of items in the list including the additional items set through SS_Map::push()} and {@link SS_Map::unshift.