Query.php
- Author
- Vasil Rangelov
- Category
- Net
- Copyright
- 2011 Vasil Rangelov
- License
- LGPL License 2.1
- Link
- http://pear2.php.net/PEAR2_Net_RouterOS
- Package
- PEAR2_Net_RouterOS
- Version
- 1.0.0b4
\PEAR2\Net\RouterOS\Query
- Author
- Vasil Rangelov
- Category
- Net
- License
- LGPL License 2.1
- Link
- http://pear2.php.net/PEAR2_Net_RouterOS
Constants
Properties
Methods


__construct() : void
This class is not to be instantiated normally, but by static methods instead. Use {@link where()} to create an instance of it.


_send(\PEAR2\Net\RouterOS\Communicator $com) : int
Sends the query over a communicator.
Name | Type | Description |
---|---|---|
$com | \PEAR2\Net\RouterOS\Communicator | The communicator to send the query over. |
Type | Description |
---|---|
int | The number of bytes sent. |


addWhere(string $name, string $value, string $action) : \PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query
Adds a condition.
Name | Type | Description |
---|---|---|
$name | string | The name of the property to test. |
$value | string | The value to test against. Not required for existence tests. |
$action | string | One of the ACTION_* constants. Describes the operation to perform. |
Type | Description |
---|---|
\PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query | The query object. |
- Fluent
- This method is part of a fluent interface and will return the same instance


andWhere(string $name, string $value = null, string $action = self::ACTION_EXIST) : \PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query
Adds a condition in addition to the query.
Name | Type | Description |
---|---|---|
$name | string | The name of the property to test. |
$value | string | The value to test against. Not required for existence tests. |
$action | string | One of the ACTION_* constants. Describes the operation to perform. |
Type | Description |
---|---|
\PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query | The query object. |
- Fluent
- This method is part of a fluent interface and will return the same instance


not() : \PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query
Negates the query.
Type | Description |
---|---|
\PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query | The query object. |
- Fluent
- This method is part of a fluent interface and will return the same instance


orWhere(string $name, string $value = null, string $action = self::ACTION_EXIST) : \PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query
Adds a condition as an alternative to the query.
Name | Type | Description |
---|---|---|
$name | string | The name of the property to test. |
$value | string | The value to test against. Not required for existence tests. |
$action | string | One of the ACTION_* constants. Describes the operation to perform. |
Type | Description |
---|---|
\PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query | The query object. |
- Fluent
- This method is part of a fluent interface and will return the same instance


sanitizeAction(string $action) : string
Sanitizes the action of a condition.
Name | Type | Description |
---|---|---|
$action | string | The action to sanitize. |
Type | Description |
---|---|
string | The sanitized action. |


send(\PEAR2\Net\RouterOS\Communicator $com) : int
Sends the query over a communicator.
Name | Type | Description |
---|---|---|
$com | \PEAR2\Net\RouterOS\Communicator | The communicator to send the query over. |
Type | Description |
---|---|
int | The number of bytes sent. |


where(string $name, string $value = null, string $action = self::ACTION_EXIST) : \PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query
Creates a new query with an initial condition.
Name | Type | Description |
---|---|---|
$name | string | The name of the property to test. |
$value | string | The value to test against. Not required for existence tests. |
$action | string | One of the ACTION_* constants. Describes the operation to perform. |
Type | Description |
---|---|
\PEAR2\Net\RouterOS\Query | \PEAR2\Net\RouterOS\Query | The query object. |
- Fluent
- This method is part of a fluent interface and will return the same instance