Permalink
Browse files

Merge pull request #34 from stojg/pull/fix-deprecated-methods

BUGFIX Usage of DataList instead of deprecated DataObject::get()
  • Loading branch information...
2 parents 89abb29 + 2365295 commit b961f9984271769d568f6a93ed801c2668e6676c @wilr wilr committed Oct 29, 2011
Showing with 3 additions and 8 deletions.
  1. +3 −8 tasks/MigrateSiteTreeLinkingTask.php
@@ -14,14 +14,9 @@ class MigrateSiteTreeLinkingTask extends BuildTask {
public function run($request) {
$pages = 0;
$links = 0;
-
- $linkedPages = DataObject::get(
- 'SiteTree',
- null,
- null,
- 'INNER JOIN "SiteTree_LinkTracking" ON "SiteTree_LinkTracking"."SiteTreeID" = "SiteTree"."ID"'
- );
-
+
+ $linkedPages = new DataList('SiteTree');
+ $linkedPages->innerJoin('SiteTree_LinkTracking', '"SiteTree_LinkTracking"."SiteTreeID" = "SiteTree"."ID"');
if($linkedPages) foreach($linkedPages as $page) {
$tracking = DB::query(sprintf('SELECT "ChildID", "FieldName" FROM "SiteTree_LinkTracking" WHERE "SiteTreeID" = %d', $page->ID))->map();

0 comments on commit b961f99

Please sign in to comment.