just another orm...
View the Project on GitHub tflori/orm
» API Reference » ORM\QueryBuilder\HasWhereConditions
public function andWhere(
string $column,
string|array $operator = null,
string $value = null,
): $this
QueryBuilderInterface andWhere($column[, $operator[, $value]]);
If $column has the same amount of question marks as $value - $value is the second parameter.
If there is no third parameter and no question mark in $column then the default operator is ‘=’ and $value is the second parameter.
These calls are equal:
$query->andWhere('name', '=' , 'John Doe');
$query->andWhere('name = ?', 'John Doe');
$query->andWhere('name', 'John Doe');
$query->andWhere('name = ?', ['John Doe']);
Returns | $this |
Parameter | Type | Description | |
---|---|---|---|
$column |
string | Column or expression with placeholders | |
$operator |
**string | array** | Operator, value or array of values |
$value |
string | Value (required when used with operator) |
ORM\QueryBuilder\HasWhereConditions::andWhere
public function orWhere(
string $column,
string|array $operator = null,
string $value = null,
): $this
QueryBuilderInterface orWhere($column[, $operator[, $value]]);
If $column has the same amount of question marks as $value - $value is the second parameter.
If there is no third parameter and no question mark in $column then the default operator is ‘=’ and $value is the second parameter.
These calls are equal:
$query->orWhere('name', '=' , 'John Doe');
$query->orWhere('name = ?', 'John Doe');
$query->orWhere('name', 'John Doe');
$query->orWhere('name = ?', ['John Doe']);
Returns | $this |
Parameter | Type | Description | |
---|---|---|---|
$column |
string | Column or expression with placeholders | |
$operator |
**string | array** | Operator, value or array of values |
$value |
string | Value (required when used with operator) |
ORM\QueryBuilder\HasWhereConditions::orWhere
public function orWhereIn(string|array $column, array $values): $this
If $column is an array a composite where in statement will be created
Example:
whereIn(['a', 'b'], [[42, 23], [42, 23]])
gets (a,b) IN ((42,23), (23,42))
in mysql
If $values is empty the expression will be 1 = 0
because an empty parenthesis causes an error in SQL.
Returns | $this |
Parameter | Type | Description | |
---|---|---|---|
$column |
**string | array** | |
$values |
array |
ORM\QueryBuilder\HasWhereConditions::orWhereIn
public function orWhereNotIn(string|array $column, array $values): $this
If $column is an array a composite where in statement will be created
Example:
whereIn(['a', 'b'], [[42, 23], [42, 23]])
gets (a,b) NOT IN ((42,23), (23,42))
in mysql
If $values is empty the expression will be 1 = 1
because an empty parenthesis causes an error in SQL.
Returns | $this |
Parameter | Type | Description | |
---|---|---|---|
$column |
**string | array** | |
$values |
array |
ORM\QueryBuilder\HasWhereConditions::orWhereNotIn
public function where(
string $column,
mixed $operator = null,
mixed $value = null,
): $this
QueryBuilderInterface where($column[, $operator[, $value]]);
If $column has the same amount of question marks as $value - $value is the second parameter.
If there is no third parameter and no question mark in $column then the default operator is ‘=’ and $value is the second parameter.
These calls are equal:
$query->where('name', '=' , 'John Doe');
$query->where('name = ?', 'John Doe');
$query->where('name', 'John Doe');
$query->where('name = ?', ['John Doe']);
Returns | $this |
Parameter | Type | Description |
---|---|---|
$column |
string | Column or expression with placeholders |
$operator |
mixed | Operator, value or array of values |
$value |
mixed | Value (required when used with operator) |
See Also:
ORM\QueryBuilder\HasWhereConditions::where
public function whereIn(string|array $column, array $values): $this
If $column is an array a composite where in statement will be created
Example:
whereIn(['a', 'b'], [[42, 23], [42, 23]])
gets (a,b) IN ((42,23), (23,42))
in mysql
If $values is empty the expression will be 1 = 0
because an empty parenthesis causes an error in SQL.
Returns | $this |
Parameter | Type | Description | |
---|---|---|---|
$column |
**string | array** | |
$values |
array |
ORM\QueryBuilder\HasWhereConditions::whereIn
public function whereNotIn(string|array $column, array $values): $this
If $column is an array a composite where in statement will be created
Example:
whereIn(['a', 'b'], [[42, 23], [42, 23]])
gets (a,b) NOT IN ((42,23), (23,42))
in mysql
If $values is empty the expression will be 1 = 1
because an empty parenthesis causes an error in SQL.
Returns | $this |
Parameter | Type | Description | |
---|---|---|---|
$column |
**string | array** | |
$values |
array |
ORM\QueryBuilder\HasWhereConditions::whereNotIn