|
static | where ( $name, $value=null, $operator=self::OP_EX) |
| Creates a new query with an initial condition. More...
|
|
|
const | OP_EX = '' |
| Checks if the property exists.
|
|
const | OP_NEX = '-' |
| Checks if the property does not exist.
|
|
const | OP_EQ = '=' |
| Checks if the property equals a certain value.
|
|
const | OP_LT = '<' |
| Checks if the property is less than a certain value.
|
|
const | OP_GT = '>' |
| Checks if the property is greater than a certain value.
|
|
Definition at line 38 of file Query.php.
◆ __construct()
This class is not to be instantiated normally, but by static methods instead.
Use static::where() to create an instance of it.
Definition at line 81 of file Query.php.
◆ addWhere()
addWhere |
( |
|
$name, |
|
|
|
$value, |
|
|
|
$operator |
|
) |
| |
|
protected |
Adds a condition.
- Parameters
-
string | $name | The name of the property to test. |
string | resource | null | $value | Value of the property as a string or seekable stream. Not required for existence tests. If a seekable stream is provided, it is sent from its current position to its end, and the pointer is seeked back to its current position after sending. Non seekable streams, as well as all other types, are casted to a string. |
string | $operator | One of the ACTION_* constants. Describes the operation to perform. |
- Returns
- $this The query object.
Definition at line 296 of file Query.php.
◆ andWhere()
andWhere |
( |
|
$name, |
|
|
|
$value = null , |
|
|
|
$operator = self::OP_EX |
|
) |
| |
Adds a condition in addition to the query.
- Parameters
-
string | $name | The name of the property to test. |
string | resource | null | $value | Value of the property as a string or seekable stream. Not required for existence tests. If a seekable stream is provided, it is sent from its current position to its end, and the pointer is seeked back to its current position after sending. Non seekable streams, as well as all other types, are casted to a string. |
string | $operator | One of the OP_* constants. Describes the operation to perform. |
- Returns
- $this The query object.
Definition at line 187 of file Query.php.
◆ not()
Negates the query.
- Returns
- $this The query object.
Definition at line 143 of file Query.php.
◆ orWhere()
orWhere |
( |
|
$name, |
|
|
|
$value = null , |
|
|
|
$operator = self::OP_EX |
|
) |
| |
Adds a condition as an alternative to the query.
- Parameters
-
string | $name | The name of the property to test. |
string | resource | null | $value | Value of the property as a string or seekable stream. Not required for existence tests. If a seekable stream is provided, it is sent from its current position to its end, and the pointer is seeked back to its current position after sending. Non seekable streams, as well as all other types, are casted to a string. |
string | $operator | One of the OP_* constants. Describes the operation to perform. |
- Returns
- $this The query object.
Definition at line 165 of file Query.php.
◆ sanitizeOperator()
static sanitizeOperator |
( |
|
$operator | ) |
|
|
staticprotected |
Sanitizes the operator of a condition.
- Parameters
-
string | $operator | The operator to sanitize. |
- Returns
- string The sanitized operator.
Definition at line 93 of file Query.php.
◆ send()
Sends the query over a communicator.
- Parameters
-
Communicator | $com | The communicator to send the query over. |
- Returns
- int The number of bytes sent.
Definition at line 200 of file Query.php.
◆ verify()
Verifies the query.
Verifies the query against a communicator, i.e. whether the query could successfully be sent (assuming the connection is still opened).
- Parameters
-
Communicator | $com | The Communicator to check against. |
- Returns
- $this The query object itself.
- Exceptions
-
LengthException | If the resulting length of an API word is not supported. |
Definition at line 260 of file Query.php.
◆ where()
static where |
( |
|
$name, |
|
|
|
$value = null , |
|
|
|
$operator = self::OP_EX |
|
) |
| |
|
static |
Creates a new query with an initial condition.
- Parameters
-
string | $name | The name of the property to test. |
string | resource | null | $value | Value of the property as a string or seekable stream. Not required for existence tests. If a seekable stream is provided, it is sent from its current position to its end, and the pointer is seeked back to its current position after sending. Non seekable streams, as well as all other types, are casted to a string. |
string | $operator | One of the OP_* constants. Describes the operation to perform. |
- Returns
- static A new query object.
Definition at line 129 of file Query.php.
The documentation for this class was generated from the following file: