mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT: wakeless - Added SQLQuery::filtersOnID()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61618 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
556031ce34
commit
872b24003b
@ -435,6 +435,17 @@ class SQLQuery extends Object {
|
|||||||
return DB::query($this->sql());
|
return DB::query($this->sql());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this query is for a specific ID in a table
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
function filtersOnID() {
|
||||||
|
return ($query->where && count($query->where) == 1 &&
|
||||||
|
(strpos($query->where[0], ".`ID` = ") || strpos($query->where[0], ".ID = ") || strpos($query->where[0], "ID = ") )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/// VARIOUS TRANSFORMATIONS BELOW
|
/// VARIOUS TRANSFORMATIONS BELOW
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user