/** * @deprecated 3.0 Use DataList::create and DataList to do your querying */ public function Aggregate($class = null) { Deprecation::notice('3.0', 'Use DataList::create and DataList to do your querying instead.'); if($class) { $list = new DataList($class); $list->setModel(DataModel::inst()); } else if(isset($this)) { $list = new DataList(get_class($this)); $list->setModel($this->model); } else throw new InvalidArgumentException("DataObject::aggregate() must be called as an instance method or passed a classname"); return $list; }
/** * @deprecated */ public function Aggregate($class = null) { if ($class) { $list = new DataList($class); $list->setModel(DataModel::inst()); } else { if (isset($this)) { $list = new DataList(get_class($this)); $list->setModel($this->model); } else { throw new InvalidArgumentException("DataObject::aggregate() must be called as an instance method or passed a classname"); } } return $list; }