API CHANGE Childclasses to SS_List matches the same signature on abstract methods column and map.

This was failing under php 5.2
This commit is contained in:
Stig Lindqvist 2011-10-22 15:42:46 +02:00
parent a2c7175caa
commit fb8ff50451
2 changed files with 3 additions and 3 deletions

View File

@ -155,7 +155,7 @@ class ArrayList extends ViewableData implements SS_List {
return end($this->items); return end($this->items);
} }
public function map($keyfield, $titlefield) { public function map($keyfield = 'ID', $titlefield = 'Title') {
$map = array(); $map = array();
foreach ($this->items as $item) { foreach ($this->items as $item) {
$map[$this->extractValue($item, $keyfield)] = $this->extractValue($item, $titlefield); $map[$this->extractValue($item, $keyfield)] = $this->extractValue($item, $titlefield);

View File

@ -67,7 +67,7 @@ interface SS_List extends ArrayAccess, Countable, IteratorAggregate {
* @param string $titlefield * @param string $titlefield
* @return array * @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 * 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 * @param string $field
* @return array * @return array
*/ */
public function column($field); public function column($colName = "ID");
/** /**
* Returns TRUE if the list can be sorted by a field. * Returns TRUE if the list can be sorted by a field.