LSDbCriteria
extends CDbCriteria
in package
Table of Contents
Methods
- addSafeStringSearchCondition() : void
- Safely apply conditions to a CDbCriteria object.
- addSafeStructuredSearchCondition() : void
- Safely apply conditions to a CDbCriteria object.
- addSearchCondition() : mixed
- inherit doc Replace escape systemfor MSSQL, mantis issue #18550
- compare() : void
- Basic initialiser to the base controller class
Methods
addSafeStringSearchCondition()
Safely apply conditions to a CDbCriteria object.
public
addSafeStringSearchCondition(model $oModel, string $condition) : void
Hardens against SQL injection by validating column names.
Parameters
- $oModel : model
-
: can be \Token or \Survey or anything else
- $condition : string
-
conditions to limit the list, either as a
Tags
addSafeStructuredSearchCondition()
Safely apply conditions to a CDbCriteria object.
public
addSafeStructuredSearchCondition(model $oModel[, array<string|int, mixed> $aConditions = [] ]) : void
Hardens against SQL injection by validating column names.
Parameters
- $oModel : model
-
: can be \Token or \Survey or anything else
- $aConditions : array<string|int, mixed> = []
-
conditions to limit the list, either as a key=>value search value in column key : sample ['tid' => '2'] key=>array(operator,value[,value[...]]) using an operator : sample ['tid'=>['=','2']] Valid operators are ['<', '>', '>=', '<=', '=', '<>', 'LIKE', 'IN'] Only the IN operator allows for several values. All conditions are connected by AND.
Tags
addSearchCondition()
inherit doc Replace escape systemfor MSSQL, mantis issue #18550
public
addSearchCondition(mixed $column, mixed $keyword[, mixed $escape = true ][, mixed $operator = 'AND' ][, mixed $like = 'LIKE' ]) : mixed
Parameters
- $column : mixed
- $keyword : mixed
- $escape : mixed = true
- $operator : mixed = 'AND'
- $like : mixed = 'LIKE'
compare()
Basic initialiser to the base controller class
public
compare(string $column, mixed $value[, bool $partialMatch = false ][, string $operator = 'AND' ][, bool $escape = true ]) : void
Parameters
- $column : string
-
The name of the column to be searched
- $value : mixed
-
The column value to be compared with
- $partialMatch : bool = false
-
Whether the value should consider partial text match
- $operator : string = 'AND'
-
The operator used to concatenate the new condition with the existing one
- $escape : bool = true
-
Whether the value should be escaped if $partialMatch is true and the value contains characters % or _