mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-07-03 01:49:37 +02:00
MINOR: Made DataObjectSet implement the SS_List interface.
This commit is contained in:
parent
b872ad7bb8
commit
26faead3e5
|
@ -5,7 +5,7 @@
|
|||
* @package sapphire
|
||||
* @subpackage model
|
||||
*/
|
||||
class DataObjectSet extends ViewableData implements IteratorAggregate, Countable, ArrayAccess {
|
||||
class DataObjectSet extends ViewableData implements SS_List {
|
||||
/**
|
||||
* The DataObjects in this set.
|
||||
* @var array
|
||||
|
@ -165,6 +165,10 @@ class DataObjectSet extends ViewableData implements IteratorAggregate, Countable
|
|||
return $this->map($index, $titleField, $emptyString, $sort);
|
||||
}
|
||||
|
||||
public function add($item) {
|
||||
$this->push($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an item to the DataObject Set.
|
||||
* @param DataObject $item Item to add.
|
||||
|
@ -529,6 +533,10 @@ class DataObjectSet extends ViewableData implements IteratorAggregate, Countable
|
|||
return $output;
|
||||
}
|
||||
|
||||
public function canSortBy($by) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the current DataObjectSet instance.
|
||||
* @param string $fieldname The name of the field on the DataObject that you wish to sort the set by.
|
||||
|
|
Loading…
Reference in New Issue
Block a user