Where
- Full name:
\Qubus\Expressive\Where
Methods
where
Add where condition, more calls appends with AND.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$condition | mixed | condition possibly containing ? or :name |
$parameters | mixed | array accepted by PDOStatement::execute or a scalar value. |
wherePK
Where Primary key
Parameters:
| Parameter | Type | Description |
|---|---|---|
$id | int|string |
whereNot
WHERE $columName != $value
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | |
$value | mixed |
whereLike
WHERE $columName LIKE $value
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | |
$value | mixed |
whereNotLike
WHERE $columName NOT LIKE $value
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | |
$value | mixed |
whereGt
WHERE $columName > $value
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | |
$value | mixed |
whereGte
WHERE $columName >= $value
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | |
$value | mixed |
whereLt
WHERE $columName < $value
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | |
$value | mixed |
whereLte
WHERE $columName <= $value
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | |
$value | mixed |
whereIn
WHERE $columName IN (?,?,?,...)
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | |
$values | list | An empty list produces an always-false predicate. |
whereNotIn
WHERE $columName NOT IN (?,?,?,...)
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | |
$values | list | An empty list adds no predicate. |
whereNull
WHERE $columName IS NULL
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string |
whereNotNull
WHERE $columName IS NOT NULL
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string |
orderBy
ORDER BY $columnName (ASC | DESC)
Parameters:
| Parameter | Type | Description |
|---|---|---|
$columnName | string | - The name of the colum or an expression |
$ordering | string | ASC or DESC, case-insensitive. |
Throws:
When the ordering is not ASC or DESC. - QueryBuilderException
limit
LIMIT $limit
Parameters:
| Parameter | Type | Description |
|---|---|---|
$limit | int|null | A non-negative limit, including zero; null reads the current limit. |
offset
OFFSET $offset
Parameters:
| Parameter | Type | Description |
|---|---|---|
$offset | int|null | A non-negative offset; null reads the current offset. |
pagination
Parameters:
| Parameter | Type | Description |
|---|---|---|
$perPage | int | |
$page | int |
and
Create an AND operator in the where clause
or
Create an OR operator in the where clause
wrap
To group multiple where clauses together.