API CHANGE: Replaced DataObjectSet instances with ArrayList.

This commit is contained in:
ajshort 2011-05-05 20:40:26 +10:00
parent e7acf678a9
commit 5cc549f57c
9 changed files with 9 additions and 9 deletions

2
code/controller/CMSMain.php Executable file → Normal file
View File

@ -280,7 +280,7 @@ JS;
public function PageTypes() { public function PageTypes() {
$classes = SiteTree::page_type_classes(); $classes = SiteTree::page_type_classes();
$result = new DataObjectSet(); $result = new ArrayList();
foreach($classes as $class) { foreach($classes as $class) {
$instance = singleton($class); $instance = singleton($class);

2
code/controller/ContentController.php Executable file → Normal file
View File

@ -314,7 +314,7 @@ class ContentController extends Controller {
} }
} }
return new DataObjectSet($visible); return new ArrayList($visible);
} }
public function Menu($level) { public function Menu($level) {

2
code/controller/ReportAdmin.php Executable file → Normal file
View File

@ -71,7 +71,7 @@ class ReportAdmin extends LeftAndMain {
* @return DataObjectSet * @return DataObjectSet
*/ */
public function Reports() { public function Reports() {
$output = new DataObjectSet(); $output = new ArrayList();
foreach(SS_Report::get_reports('ReportAdmin') as $report) { foreach(SS_Report::get_reports('ReportAdmin') as $report) {
if($report->canView()) $output->push($report); if($report->canView()) $output->push($report);
} }

2
code/model/SiteTree.php Executable file → Normal file
View File

@ -1608,7 +1608,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if(is_callable('Subsite::disable_subsite_filter')) Subsite::disable_subsite_filter(true); if(is_callable('Subsite::disable_subsite_filter')) Subsite::disable_subsite_filter(true);
// Content links // Content links
$items = new DataObjectSet(); $items = new ArrayList();
// We merge all into a regular DataObjectSet, because DataList doesn't support merge // We merge all into a regular DataObjectSet, because DataList doesn't support merge
if($contentLinks = $this->BackLinkTracking()) { if($contentLinks = $this->BackLinkTracking()) {

View File

@ -33,7 +33,7 @@ class BrokenLinksReport extends SS_Report {
if (!isset($_REQUEST['CheckSite']) || $params['CheckSite'] == 'Published') $ret = Versioned::get_by_stage('SiteTree', 'Live', "({$q}SiteTree{$q}.{$q}HasBrokenLink{$q} = 1 OR {$q}SiteTree{$q}.{$q}HasBrokenFile{$q} = 1)", $sort, $join, $limit); if (!isset($_REQUEST['CheckSite']) || $params['CheckSite'] == 'Published') $ret = Versioned::get_by_stage('SiteTree', 'Live', "({$q}SiteTree{$q}.{$q}HasBrokenLink{$q} = 1 OR {$q}SiteTree{$q}.{$q}HasBrokenFile{$q} = 1)", $sort, $join, $limit);
else $ret = DataObject::get('SiteTree', "({$q}SiteTree{$q}.{$q}HasBrokenFile{$q} = 1 OR {$q}HasBrokenLink{$q} = 1)", $sort, $join, $limit); else $ret = DataObject::get('SiteTree', "({$q}SiteTree{$q}.{$q}HasBrokenFile{$q} = 1 OR {$q}HasBrokenLink{$q} = 1)", $sort, $join, $limit);
$returnSet = new DataObjectSet(); $returnSet = new ArrayList();
if ($ret) foreach($ret as $record) { if ($ret) foreach($ret as $record) {
$reason = false; $reason = false;
$isRedirectorPage = in_array($record->ClassName, ClassInfo::subclassesFor('RedirectorPage')); $isRedirectorPage = in_array($record->ClassName, ClassInfo::subclassesFor('RedirectorPage'));

View File

@ -29,7 +29,7 @@ class WidgetArea extends DataObject {
* @return DataObjectSet Collection of {@link Widget_Controller} * @return DataObjectSet Collection of {@link Widget_Controller}
*/ */
function WidgetControllers() { function WidgetControllers() {
$controllers = new DataObjectSet(); $controllers = new ArrayList();
foreach($this->ItemsToRender() as $widget) { foreach($this->ItemsToRender() as $widget) {
// find controller // find controller

View File

@ -28,7 +28,7 @@ class WidgetAreaEditor extends FormField {
function AvailableWidgets() { function AvailableWidgets() {
$widgets= new DataObjectSet(); $widgets= new ArrayList();
foreach($this->widgetClasses as $widgetClass) { foreach($this->widgetClasses as $widgetClass) {
$classes = ClassInfo::subclassesFor($widgetClass); $classes = ClassInfo::subclassesFor($widgetClass);

View File

@ -325,7 +325,7 @@ in the other stage:<br />
$filter .= ($filter) ? ' AND ' : ''; $filter .= ($filter) ? ' AND ' : '';
$filter .= sprintf("\"%s\".\"ParentID\" != 0 AND \"Parents\".\"ID\" IS NULL", $class); $filter .= sprintf("\"%s\".\"ParentID\" != 0 AND \"Parents\".\"ID\" IS NULL", $class);
$orphans = new DataObjectSet(); $orphans = new ArrayList();
foreach(array('Stage', 'Live') as $stage) { foreach(array('Stage', 'Live') as $stage) {
$joinByStage = $join; $joinByStage = $join;
$table = $class; $table = $class;

View File

@ -22,6 +22,6 @@ class SSReportTest_FakeTest extends SS_Report implements TestOnly {
); );
} }
function sourceRecords($params, $sort, $limit) { function sourceRecords($params, $sort, $limit) {
return new DataObjectSet(); return new ArrayList();
} }
} }