\Message.php

Show: inherited

RouterOS API client implementation.

This package allows you to read and write information from a RouterOS host using MikroTik's RouterOS API.

PHP version 5

Author
Vasil Rangelov  
Category
Net  
Copyright
2011 Vasil Rangelov  
License
LGPL License 2.1  
Link
http://netrouteros.sourceforge.net/  
Package
PEAR2_Net_RouterOS  
Version
1.0.0b1  

\PEAR2\Net\RouterOS\Message

Package: PEAR2\Net\RouterOS

Represents a RouterOS message.

Children
\PEAR2\Net\RouterOS\Request
\PEAR2\Net\RouterOS\Response
Author
Vasil Rangelov  
Category
Net  
License
LGPL License 2.1  
Link
http://netrouteros.sourceforge.net/  

Properties

Propertyprivatestring  $_tag= 'null'

An optional tag to associate the message with.
Default valuenullDetails
Type
string
Propertyprotectedarray  $arguments= 'array('

An array with message arguments. Keys are the names of the arguments, array values are values for the corresponding argument.
Default valuearray(Details
Type
array

Methods

methodpublicgetAllArguments( ) : array

Gets all arguments in an array.

Returns
Type Description
array An array with the keys as argument names, and the array values as argument values.
Details
See
\PEAR2\Net\RouterOS\getArgument()  
See
\PEAR2\Net\RouterOS\setArgument()  
methodpublicgetArgument( string $name ) : string|resource

Gets the value of an argument.

Parameters
Name Type Description
$name string

The name of the argument.

Returns
Type Description
string|resource The value of the specified argument. Returns NULL if such an argument is not set.
Details
See
\PEAR2\Net\RouterOS\setArgument()  
methodpublicgetTag( ) : string

Gets the tag that the message is associated with.

Returns
Type Description
string The current tag or NULL if there isn't a tag.
Details
See
\PEAR2\Net\RouterOS\setTag()  
methodprotectedremoveAllArguments( ) : \PEAR2\Net\RouterOS\Message

Removes all arguments from the message.

Returns
Type Description
\PEAR2\Net\RouterOS\Message The message object.
methodpublicsanitizeArgumentName( mixed $name ) : string
static

Sanitizes a name of an argument (message or query one).

Parameters
Name Type Description
$name mixed

The name to sanitize.

Returns
Type Description
string The sanitized name.
methodpublicsanitizeArgumentValue( mixed $value ) : string
static

Sanitizes a value of an argument (message or query one).

Parameters
Name Type Description
$value mixed

The value to sanitize.

Returns
Type Description
string The sanitized value.
methodprotectedsetArgument( string $name, string $value = null ) : \PEAR2\Net\RouterOS\Message

Sets an argument for the message.

Parameters
Name Type Description
$name string

Name of the argument.

$value string

Value of the argument. Setting the value to NULL removes an argument of this name.

Returns
Type Description
\PEAR2\Net\RouterOS\Message The message object.
Details
See
\PEAR2\Net\RouterOS\getArgument()  
methodprotectedsetTag( string $tag ) : \PEAR2\Net\RouterOS\Message

Sets the tag to associate the request with.

Sets the tag to associate the message with. Setting NULL erases the currently set tag.

Parameters
Name Type Description
$tag string

The tag to set.

Returns
Type Description
\PEAR2\Net\RouterOS\Message The message object.
Details
See
\PEAR2\Net\RouterOS\getTag()  
Documentation was generated by DocBlox 0.14.1.