mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Removing join() on DataList/DataQuery
Use leftJoin() or innerJoin() instead
This commit is contained in:
parent
b43b023c1e
commit
68bb74820a
@ -233,20 +233,6 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new DataList instance with a join clause added to this list's query.
|
||||
*
|
||||
* @param type $join Escaped SQL statement
|
||||
* @return DataList
|
||||
* @deprecated 3.0
|
||||
*/
|
||||
public function join($join) {
|
||||
Deprecation::notice('3.0', 'Use innerJoin() or leftJoin() instead.');
|
||||
return $this->alterDataQuery_30(function($query) use ($join){
|
||||
$query->join($join);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new DataList instance with the records returned in this query restricted by a limit clause
|
||||
*
|
||||
|
@ -530,24 +530,6 @@ class DataQuery {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a join clause to this query
|
||||
* @deprecated 3.0 Use innerJoin() or leftJoin() instead.
|
||||
*/
|
||||
public function join($join) {
|
||||
Deprecation::notice('3.0', 'Use innerJoin() or leftJoin() instead.');
|
||||
if($join) {
|
||||
$this->query->addFrom($join);
|
||||
// TODO: This needs to be resolved for all databases
|
||||
|
||||
if(DB::getConn() instanceof MySQLDatabase) {
|
||||
$from = $this->query->getFrom();
|
||||
$this->query->setGroupBy(reset($from) . ".\"ID\"");
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an INNER JOIN clause to this query.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user