PHP Трейт Bluz\Db\Query\Traits\Where

Required for: - Select Builder - Update Builder - Delete Builder
Автор: Anton Shevchuk
Показать файл Открыть проект

Открытые методы

Метод Описание
andWhere ( $condition ) Add WHERE .
orWhere ( $condition ) Add WHERE .
where ( $condition ) Set WHERE condition

Описание методов

andWhere() публичный Метод

. AND .. condition Adds one or more restrictions to the query results, forming a logical conjunction with any previously specified restrictions. $sb = new SelectBuilder(); $sb ->select('u') ->from('users', 'u') ->where('u.username LIKE ?', '%Smith%') ->andWhere('u.is_active = ?', 1);
public andWhere ( $condition )
$condition Optional the query restriction predicates

orWhere() публичный Метод

. OR .. condition Adds one or more restrictions to the query results, forming a logical disjunction with any previously specified restrictions. $sb = new SelectBuilder(); $sb ->select('u.name') ->from('users', 'u') ->where('u.id = 1') ->orWhere('u.id = ?', 2);
public orWhere ( $condition )
$condition Optional the query restriction predicates

where() публичный Метод

Specifies one or more restrictions to the query result Replaces any previously specified restrictions, if any $sb = new SelectBuilder(); $sb ->select('u.name') ->from('users', 'u') ->where('u.id = ?', $id) ;
public where ( $condition )
$condition optional the query restriction predicates