diff --git a/model/ListDecorator.php b/model/ListDecorator.php index 7ca89de91..ccea22054 100644 --- a/model/ListDecorator.php +++ b/model/ListDecorator.php @@ -1,25 +1,27 @@ list = $list; + public function __construct(SS_List $list) { + $this->list = $list; + $this->failover = $this->list; + parent::__construct(); } /** * Returns the list this decorator wraps around. * - * @return DataObjectSet + * @return SS_List */ public function getList() { return $this->list; @@ -43,14 +45,6 @@ abstract class SS_ListDecorator extends DataObjectSet { $this->list->offsetUnset($key); } - public function destroy() { - $this->list->destroy(); - } - - public function emptyItems() { - $this->list->emptyItems(); - } - public function toArray($index = null) { return $this->list->toArray($index); } @@ -59,38 +53,14 @@ abstract class SS_ListDecorator extends DataObjectSet { return $this->list->toNestedArray($index); } - public function push($item, $key = null) { - $this->list->push($item, $key); - } - - public function insertFirst($item, $key = null) { - $this->list->insertFirst($item, $key); - } - - public function unshift($item) { - $this->list->unshift($item); - } - - public function shift() { - return $this->list->shift(); - } - - public function pop() { - return $this->list->pop(); + public function add($item) { + $this->list->add($item); } public function remove($itemObject) { $this->list->remove($itemObject); } - public function replace($itemOld, $itemNew) { - $this->list->replace($itemOld, $itemNew); - } - - public function merge($anotherSet){ - $this->list->merge($anotherSet); - } - public function getRange($offset, $length) { return $this->list->getRange($offset, $length); } @@ -119,10 +89,6 @@ abstract class SS_ListDecorator extends DataObjectSet { return $this->list->Count(); } - public function UL() { - return $this->list->UL(); - } - public function forTemplate() { return $this->list->forTemplate(); } @@ -139,59 +105,16 @@ abstract class SS_ListDecorator extends DataObjectSet { return $this->list->column($value); } - public function groupBy($index){ - return $this->list->groupBy($index); - } - - public function GroupedBy($index, $childControl = "Children") { - return $this->list->GroupedBy($index, $childControl); - } - - public function buildNestedUL($nestingLevels, $ulExtraAttributes = '') { - return $this->list->buildNestedUL($nestingLevels, $ulExtraAttributes); - } - - public function getChildrenAsUL($nestingLevels, $level = 0, $template = "
  • \$Title", $ulExtraAttributes = null, &$itemCount = 0) { - return $this->list->getChildrenAsUL( - $nestingLevels, - $level, - $template, - $ulExtraAttributes, - $itemCount); + public function canSortBy($by) { + return $this->list->canSortBy($by); } public function sort($fieldname, $direction = "ASC") { $this->list->sort($fieldname, $direction); } - public function removeDuplicates($field = 'ID') { - $this->list->removeDuplicates($field); - } - public function debug() { return $this->list->debug(); } - public function groupWithParents($groupField, $groupClassName, $sortParents = null, $parentField = 'ID', $collapse = false, $requiredParents = null) { - return $this->list->groupWithParents( - $groupField, - $groupClassName, - $sortParents, - $parentField, - $collapse, - $requiredParents); - } - - public function addWithoutWrite($field) { - $this->list->addWithoutWrite($field); - } - - public function containsIDs($idList) { - return $this->list->condaintsIDs($idList); - } - - public function onlyContainsIDs($idList) { - return $this->list->onlyContainsIDs($idList); - } - } \ No newline at end of file