Merge pull request #70 from stojg/ss_list-changes

API CHANGE Childclasses to SS_List matches the same signature on abstract
This commit is contained in:
Sam Minnée 2011-10-27 20:09:25 -07:00
commit 92e8f6a2f4
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.