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

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100490 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-03-04 04:18:34 +00:00 committed by Sam Minnee
parent d91fa6fdfd
commit 3d41240478

View File

@ -594,33 +594,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.
*
@ -644,21 +617,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