Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUG: Replaced extendedSQL/buildSQL with DataList as per ticket 8183

BUG: Correcting the4 case of a function

Corrcting the case of a function

BUG: replaced deprecated extendedSQL call with DataList->where
  • Loading branch information...
commit e1e64839e2aa84d76dbe32422d748c5e8952a878 1 parent 072b485
@kmayo-ss kmayo-ss authored
View
3  model/Aggregate.php
@@ -76,8 +76,7 @@ public function __construct($type, $filter = '') {
* @return SQLQuery
*/
protected function query($attr) {
- $singleton = singleton($this->type);
- $query = $singleton->buildSQL($this->filter);
+ $query = DataList::create($this->type)->where($this->filter);
$query->setSelect($attr);
$query->setOrderBy(array());
$singleton->extend('augmentSQL', $query);
View
5 model/DataObject.php
@@ -1434,7 +1434,10 @@ public function getComponentsQuery($componentName, $filter = "", $sort = "", $jo
$combinedFilter = "\"$joinField\" = '$id'";
if(!empty($filter)) $combinedFilter .= " AND ({$filter})";
- return singleton($componentClass)->extendedSQL($combinedFilter, $sort, $limit, $join);
+ return DataList::create($componentClass)
+ ->where($combinedFilter)
+ ->canSortBy($sort)
+ ->limit($limit);
}
/**
View
2  model/DataQuery.php
@@ -111,7 +111,7 @@ public function initialiseQuery() {
user_error("DataObjects have been requested before the manifest is loaded. Please ensure you are not"
. " querying the database in _config.php.", E_USER_ERROR);
} else {
- user_error("DataObject::buildSQL: Can't find data classes (classes linked to tables) for"
+ user_error("DataList::create Can't find data classes (classes linked to tables) for"
. " $this->dataClass. Please ensure you run dev/build after creating a new DataObject.",
E_USER_ERROR);
}
Please sign in to comment.
Something went wrong with that request. Please try again.