diff --git a/model/ArrayList.php b/model/ArrayList.php index 986ea8e45..c339dd279 100644 --- a/model/ArrayList.php +++ b/model/ArrayList.php @@ -155,7 +155,7 @@ class ArrayList extends ViewableData implements SS_List { return end($this->items); } - public function map($keyfield, $titlefield) { + public function map($keyfield = 'ID', $titlefield = 'Title') { $map = array(); foreach ($this->items as $item) { $map[$this->extractValue($item, $keyfield)] = $this->extractValue($item, $titlefield); diff --git a/model/List.php b/model/List.php index 96c7e2048..0b18663e1 100644 --- a/model/List.php +++ b/model/List.php @@ -67,7 +67,7 @@ interface SS_List extends ArrayAccess, Countable, IteratorAggregate { * @param string $titlefield * @return array */ - public function map($keyfield, $titlefield); + public function map($keyfield = 'ID', $titlefield = 'Title'); /** * Returns the first item in the list where the key field is equal to the @@ -85,7 +85,7 @@ interface SS_List extends ArrayAccess, Countable, IteratorAggregate { * @param string $field * @return array */ - public function column($field); + public function column($colName = "ID"); /** * Returns TRUE if the list can be sorted by a field.