Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Using new API methods after SQLQuery API changes

  • Loading branch information...
commit 45810a1848b5d21f98ab518d45a70f5eeb735635 1 parent f545f52
@halkyon halkyon authored
Showing with 10 additions and 10 deletions.
  1. +10 −10 code/controllers/CMSSiteTreeFilter.php
View
20 code/controllers/CMSSiteTreeFilter.php
@@ -74,9 +74,9 @@ protected function populateIDs() {
if(!empty($parents)) {
$q = new SQLQuery();
- $q->select(array('"ID"','"ParentID"'))
- ->from('"SiteTree"')
- ->where('"ID" in ('.implode(',',array_keys($parents)).')');
+ $q->setSelect(array('"ID"','"ParentID"'))
+ ->setFrom('"SiteTree"')
+ ->setWhere('"ID" in ('.implode(',',array_keys($parents)).')');
foreach($q->execute() as $row) {
if ($row['ParentID']) $parents[$row['ParentID']] = true;
@@ -144,10 +144,10 @@ static function title() {
function pagesIncluded() {
$ids = array();
$q = new SQLQuery();
- $q->select(array('"SiteTree"."ID"','"SiteTree"."ParentID"'))
- ->from('"SiteTree"')
- ->leftJoin('SiteTree_Live', '"SiteTree_Live"."ID" = "SiteTree"."ID"')
- ->where('"SiteTree"."Version" > "SiteTree_Live"."Version"');
+ $q->setSelect(array('"SiteTree"."ID"','"SiteTree"."ParentID"'))
+ ->setFrom('"SiteTree"')
+ ->addLeftJoin('SiteTree_Live', '"SiteTree_Live"."ID" = "SiteTree"."ID"')
+ ->setWhere('"SiteTree"."Version" > "SiteTree_Live"."Version"');
foreach($q->execute() as $row) {
$ids[] = array('ID'=>$row['ID'],'ParentID'=>$row['ParentID']);
@@ -176,8 +176,8 @@ static function title() {
function pagesIncluded() {
$ids = array();
$q = new SQLQuery();
- $q->select(array('"ID"','"ParentID"'))
- ->from('"SiteTree"');
+ $q->setSelect(array('"ID"','"ParentID"'))
+ ->setFrom('"SiteTree"');
$where = array();
$SQL_params = Convert::raw2sql($this->params);
@@ -207,7 +207,7 @@ function pagesIncluded() {
}
}
}
- $q->where(empty($where) ? '' : '(' . implode(') AND (',$where) . ')');
+ $q->setWhere(empty($where) ? '' : '(' . implode(') AND (',$where) . ')');
foreach($q->execute() as $row) {
$ids[] = array('ID'=>$row['ID'],'ParentID'=>$row['ParentID']);
Please sign in to comment.
Something went wrong with that request. Please try again.