PEAR2_Net_RouterOS  1.0.0b5
A MikroTik RouterOS client
 All Data Structures Namespaces Files Functions Variables Pages
Query Class Reference

Public Member Functions

 not ()
 Negates the query. More...
 
 orWhere ($name, $value=null, $operator=self::OP_EX)
 Adds a condition as an alternative to the query. More...
 
 andWhere ($name, $value=null, $operator=self::OP_EX)
 Adds a condition in addition to the query. More...
 
 send (Communicator $com)
 Sends the query over a communicator. More...
 

Static Public Member Functions

static where ($name, $value=null, $operator=self::OP_EX)
 Creates a new query with an initial condition. More...
 

Data Fields

const OP_EX = ''
 Checks if the property exists. More...
 
const OP_NEX = '-'
 Checks if the property does not exist. More...
 
const OP_EQ = '='
 Checks if the property equals a certain value. More...
 
const OP_LT = '<'
 Checks if the property is less than a certain value. More...
 
const OP_GT = '>'
 Checks if the property is greather than a certain value. More...
 

Protected Member Functions

 addWhere ($name, $value, $operator)
 Adds a condition. More...
 

Static Protected Member Functions

static sanitizeOperator ($operator)
 Sanitizes the operator of a condition. More...
 

Protected Attributes

 $words = array()
 

Detailed Description

Definition at line 37 of file Query.php.

Member Function Documentation

addWhere (   $name,
  $value,
  $operator 
)
protected

Adds a condition.

Parameters
string$nameThe name of the property to test.
string | resource | null$valueValue 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 posistion 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$operatorOne of the ACTION_* constants. Describes the operation to perform.
Returns
$this The query object.

Definition at line 258 of file Query.php.

andWhere (   $name,
  $value = null,
  $operator = self::OP_EX 
)

Adds a condition in addition to the query.

Parameters
string$nameThe name of the property to test.
string | resource | null$valueValue 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 posistion 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$operatorOne of the OP_* constants. Describes the operation to perform.
Returns
$this The query object.

Definition at line 182 of file Query.php.

not ( )

Negates the query.

Returns
$this The query object.

Definition at line 138 of file Query.php.

orWhere (   $name,
  $value = null,
  $operator = self::OP_EX 
)

Adds a condition as an alternative to the query.

Parameters
string$nameThe name of the property to test.
string | resource | null$valueValue 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 posistion 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$operatorOne of the OP_* constants. Describes the operation to perform.
Returns
$this The query object.

Definition at line 160 of file Query.php.

static sanitizeOperator (   $operator)
staticprotected

Sanitizes the operator of a condition.

Parameters
string$operatorThe operator to sanitize.
Returns
string The sanitized operator.

Definition at line 88 of file Query.php.

send ( Communicator  $com)

Sends the query over a communicator.

Parameters
Communicator$comThe communicator to send the query over.
Returns
int The number of bytes sent.

Definition at line 195 of file Query.php.

static where (   $name,
  $value = null,
  $operator = self::OP_EX 
)
static

Creates a new query with an initial condition.

Parameters
string$nameThe name of the property to test.
string | resource | null$valueValue 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 posistion 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$operatorOne of the OP_* constants. Describes the operation to perform.
Returns
static A new query object.

Definition at line 124 of file Query.php.

Field Documentation

$words = array()
protected

Definition at line 70 of file Query.php.

const OP_EQ = '='

Checks if the property equals a certain value.

Definition at line 53 of file Query.php.

const OP_EX = ''

Checks if the property exists.

Definition at line 43 of file Query.php.

const OP_GT = '>'

Checks if the property is greather than a certain value.

Definition at line 63 of file Query.php.

const OP_LT = '<'

Checks if the property is less than a certain value.

Definition at line 58 of file Query.php.

const OP_NEX = '-'

Checks if the property does not exist.

Definition at line 48 of file Query.php.


The documentation for this class was generated from the following file: