From a54963d954d54a3733e5e49c9493cbd4dbe51b0f Mon Sep 17 00:00:00 2001 From: ajshort Date: Thu, 5 May 2011 20:40:26 +1000 Subject: [PATCH] API CHANGE: Replaced DataObjectSet instances with ArrayList. --- code/controllers/CMSMain.php | 2 +- code/controllers/ContentController.php | 2 +- code/controllers/ReportAdmin.php | 2 +- code/model/SiteTree.php | 2 +- code/reports/BrokenLinksReport.php | 2 +- code/widgets/WidgetArea.php | 2 +- code/widgets/WidgetAreaEditor.php | 2 +- tasks/RemoveOrphanedPagesTask.php | 2 +- tests/reports/SSReportTest.php | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 3aa52a4d..1e61f853 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -296,7 +296,7 @@ JS; public function PageTypes() { $classes = SiteTree::page_type_classes(); - $result = new DataObjectSet(); + $result = new ArrayList(); foreach($classes as $class) { $instance = singleton($class); diff --git a/code/controllers/ContentController.php b/code/controllers/ContentController.php index b1cc12b8..0f58c572 100644 --- a/code/controllers/ContentController.php +++ b/code/controllers/ContentController.php @@ -314,7 +314,7 @@ class ContentController extends Controller { } } - return new DataObjectSet($visible); + return new ArrayList($visible); } public function Menu($level) { diff --git a/code/controllers/ReportAdmin.php b/code/controllers/ReportAdmin.php index 9da06fda..2fb743cb 100644 --- a/code/controllers/ReportAdmin.php +++ b/code/controllers/ReportAdmin.php @@ -71,7 +71,7 @@ class ReportAdmin extends LeftAndMain { * @return DataObjectSet */ public function Reports() { - $output = new DataObjectSet(); + $output = new ArrayList(); foreach(SS_Report::get_reports('ReportAdmin') as $report) { if($report->canView()) $output->push($report); } diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index b1ef1152..3a9f7e70 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1618,7 +1618,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid if(is_callable('Subsite::disable_subsite_filter')) Subsite::disable_subsite_filter(true); // Content links - $items = new DataObjectSet(); + $items = new ArrayList(); // We merge all into a regular DataObjectSet, because DataList doesn't support merge if($contentLinks = $this->BackLinkTracking()) { diff --git a/code/reports/BrokenLinksReport.php b/code/reports/BrokenLinksReport.php index 96439bb4..04c7e466 100644 --- a/code/reports/BrokenLinksReport.php +++ b/code/reports/BrokenLinksReport.php @@ -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); 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) { $reason = false; $isRedirectorPage = in_array($record->ClassName, ClassInfo::subclassesFor('RedirectorPage')); diff --git a/code/widgets/WidgetArea.php b/code/widgets/WidgetArea.php index 710da822..2d00a010 100644 --- a/code/widgets/WidgetArea.php +++ b/code/widgets/WidgetArea.php @@ -29,7 +29,7 @@ class WidgetArea extends DataObject { * @return DataObjectSet Collection of {@link Widget_Controller} */ function WidgetControllers() { - $controllers = new DataObjectSet(); + $controllers = new ArrayList(); foreach($this->ItemsToRender() as $widget) { // find controller diff --git a/code/widgets/WidgetAreaEditor.php b/code/widgets/WidgetAreaEditor.php index 230571b6..d53581a5 100644 --- a/code/widgets/WidgetAreaEditor.php +++ b/code/widgets/WidgetAreaEditor.php @@ -28,7 +28,7 @@ class WidgetAreaEditor extends FormField { function AvailableWidgets() { - $widgets= new DataObjectSet(); + $widgets= new ArrayList(); foreach($this->widgetClasses as $widgetClass) { $classes = ClassInfo::subclassesFor($widgetClass); diff --git a/tasks/RemoveOrphanedPagesTask.php b/tasks/RemoveOrphanedPagesTask.php index 30083d9f..7a5b9d0d 100644 --- a/tasks/RemoveOrphanedPagesTask.php +++ b/tasks/RemoveOrphanedPagesTask.php @@ -325,7 +325,7 @@ in the other stage:
$filter .= ($filter) ? ' AND ' : ''; $filter .= sprintf("\"%s\".\"ParentID\" != 0 AND \"Parents\".\"ID\" IS NULL", $class); - $orphans = new DataObjectSet(); + $orphans = new ArrayList(); foreach(array('Stage', 'Live') as $stage) { $joinByStage = $join; $table = $class; diff --git a/tests/reports/SSReportTest.php b/tests/reports/SSReportTest.php index 14ec8a8e..a805a7ba 100644 --- a/tests/reports/SSReportTest.php +++ b/tests/reports/SSReportTest.php @@ -22,6 +22,6 @@ class SSReportTest_FakeTest extends SS_Report implements TestOnly { ); } function sourceRecords($params, $sort, $limit) { - return new DataObjectSet(); + return new ArrayList(); } } \ No newline at end of file