Message.php
RouterOS API client implementation.
RouterOS is the flag product of the company MikroTik and is a powerful router software. One of its many abilities is to allow control over it via an API. This package provides a client for that API, in turn allowing you to use PHP to control RouterOS hosts.
PHP version 5
- 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\Message
Package: PEAR2_Net_RouterOS
Returns





Returns
Details
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://pear2.php.net/PEAR2_Net_RouterOS
Properties
Methods


__invoke(string $name = null) : string | array
A shorthand gateway.
This is a magic PHP method that allows you to call the object as a
function. Depending on the argument given, one of the other functions in
the class is invoked and its returned value is returned by this function.
ParametersName | Type | Description |
---|---|---|
$name | string | The name of an argument to get the value of, or NULL to get all arguments as an array. |
Type | Description |
---|---|
string | array | The value of the specified argument, or an array of all arguments if NULL is provided. |


removeAllArguments() : \PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\Message
Removes all arguments from the message.
Returns
Details
Type | Description |
---|---|
\PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\Message | The message object. |
- Fluent
- This method is part of a fluent interface and will return the same instance


sanitizeArgumentName(mixed $name) : string
static
Sanitizes a name of an argument (message or query one).
Parameters
Returns
Name | Type | Description |
---|---|---|
$name | mixed | The name to sanitize. |
Type | Description |
---|---|
string | The sanitized name. |


sanitizeArgumentValue(mixed $value) : string
static
Sanitizes a value of an argument (message or query one).
Parameters
Returns
Name | Type | Description |
---|---|---|
$value | mixed | The value to sanitize. |
Type | Description |
---|---|
string | The sanitized value. |


setArgument(string $name, string $value = '') : \PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\Message
Sets an argument for the message.
Parameters
Returns
Details
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. |
Type | Description |
---|---|
\PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\Message | The message object. |


setTag(string $tag) : \PEAR2\Net\RouterOS\Message | \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.
ParametersName | Type | Description |
---|---|---|
$tag | string | The tag to set. |
Type | Description |
---|---|
\PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\Message | The message object. |