API CHANGE Removed deprecated methods DataObjectSet::filter_map() and DataObjectSet::map_multiple() - please use map() instead! (from r100490)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105576 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-05-25 03:55:47 +00:00
parent 7e8a2c10c9
commit a06e2af9ef

View File

@ -627,33 +627,6 @@ class DataObjectSet extends ViewableData implements IteratorAggregate, Countable
return $this->UL();
}
/**
* Returns the dataset as an array of ID => "FirstName Surname"
*
* @deprecated 2.4 Please use map() instead, pointing the title
* to a method name that does the concatenation of values.
*
* @param string $key Field name to index the array.
* @param array $values An array of fieldnames to insert in array
* @param boolean $withdash Add dashes inbetween values
* @return array
*/
public function map_multiple($key = "ID", $values = array("FirstName", "Surname"), $withdash = false){
foreach($this->items as $item) {
$mapValues = array();
foreach($values as $value) {
$mapValues[] = $item->$value;
}
if($withdash) {
$map[$item->$key] = implode(" - ", $mapValues);
} else {
$map[$item->$key] = implode(" ", $mapValues);
}
}
return $map;
}
/**
* Returns an array of ID => Title for the items in this set.
*
@ -677,21 +650,6 @@ class DataObjectSet extends ViewableData implements IteratorAggregate, Countable
return $map;
}
/**
* Temporary filter method for filtering a list based on multiple fields of the DataObject.
*
* Question: should any args be passed to the filter function?
*
* @deprecated 2.4 Please use map() instead
*/
public function filter_map($key, $value) {
$map = array();
foreach($this->items as $object) {
$map[$object->$key] = ($object->hasMethod($value)) ? $object->$value() : $object->$value;
}
return $map;
}
/**
* Find an item in this list where the field $key is equal to $value