mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MNT Deprecate unusable property
This property must always have the value 'AND' or an exception will be thrown - it should be deprecated. Also, no need to process the query before throwing.
This commit is contained in:
parent
76be4578d6
commit
4e53c35b53
@ -74,7 +74,8 @@ class SearchContext
|
||||
protected $searchParams = [];
|
||||
|
||||
/**
|
||||
* The logical connective used to join WHERE clauses. Defaults to AND.
|
||||
* The logical connective used to join WHERE clauses. Must be "AND".
|
||||
* @deprecated 5.0
|
||||
* @var string
|
||||
*/
|
||||
public $connective = 'AND';
|
||||
@ -146,6 +147,10 @@ class SearchContext
|
||||
*/
|
||||
public function getQuery($searchParams, $sort = false, $limit = false, $existingQuery = null)
|
||||
{
|
||||
if ($this->connective != "AND") {
|
||||
throw new Exception("SearchContext connective '$this->connective' not supported after ORM-rewrite.");
|
||||
}
|
||||
|
||||
/** DataList $query */
|
||||
$query = null;
|
||||
if ($existingQuery) {
|
||||
@ -204,10 +209,6 @@ class SearchContext
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->connective != "AND") {
|
||||
throw new Exception("SearchContext connective '$this->connective' not supported after ORM-rewrite.");
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user