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
This commit is contained in:
Kirk Mayo 2013-01-24 08:41:37 +13:00
parent 072b485f66
commit e1e64839e2
3 changed files with 6 additions and 4 deletions

View File

@ -76,8 +76,7 @@ class Aggregate extends ViewableData {
* @return SQLQuery * @return SQLQuery
*/ */
protected function query($attr) { protected function query($attr) {
$singleton = singleton($this->type); $query = DataList::create($this->type)->where($this->filter);
$query = $singleton->buildSQL($this->filter);
$query->setSelect($attr); $query->setSelect($attr);
$query->setOrderBy(array()); $query->setOrderBy(array());
$singleton->extend('augmentSQL', $query); $singleton->extend('augmentSQL', $query);

View File

@ -1434,7 +1434,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
$combinedFilter = "\"$joinField\" = '$id'"; $combinedFilter = "\"$joinField\" = '$id'";
if(!empty($filter)) $combinedFilter .= " AND ({$filter})"; 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 File

@ -111,7 +111,7 @@ class DataQuery {
user_error("DataObjects have been requested before the manifest is loaded. Please ensure you are not" 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); . " querying the database in _config.php.", E_USER_ERROR);
} else { } 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.", . " $this->dataClass. Please ensure you run dev/build after creating a new DataObject.",
E_USER_ERROR); E_USER_ERROR);
} }