Message.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
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
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

>VPropertyprivatestring $_tag = null

An optional tag to associate the message with.

Default valuenullDetails
Type
string
>VPropertyprotectedarray $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

methodpublic__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.
Parameters
NameTypeDescription
$namestring

The name of an argument to get the value of, or NULL to get all arguments as an array.

Returns
TypeDescription
string | arrayThe value of the specified argument, or an array of all arguments if NULL is provided.
methodpublicgetAllArguments() : array

Gets all arguments in an array.

Returns
TypeDescription
arrayAn array with the keys as argument names, and the array values as argument values.
Details
See
 
See
 
methodpublicgetArgument(string $name) : string | resource

Gets the value of an argument.

Parameters
NameTypeDescription
$namestring

The name of the argument.

Returns
TypeDescription
string | resourceThe value of the specified argument. Returns NULL if such an argument is not set.
Details
See
 
methodpublicgetTag() : string

Gets the tag that the message is associated with.

Returns
TypeDescription
stringThe current tag or NULL if there isn't a tag.
Details
See
 
methodprotectedremoveAllArguments() : \PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\Message

Removes all arguments from the message.

Returns
TypeDescription
\PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\MessageThe message object.
Details
Fluent
This method is part of a fluent interface and will return the same instance  
methodpublicsanitizeArgumentName(mixed $name) : string
static

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

Parameters
NameTypeDescription
$namemixed

The name to sanitize.

Returns
TypeDescription
stringThe sanitized name.
methodpublicsanitizeArgumentValue(mixed $value) : string
static

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

Parameters
NameTypeDescription
$valuemixed

The value to sanitize.

Returns
TypeDescription
stringThe sanitized value.
methodprotectedsetArgument(string $name, string $value = '') : \PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\Message

Sets an argument for the message.

Parameters
NameTypeDescription
$namestring

Name of the argument.

$valuestring

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

Returns
TypeDescription
\PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\MessageThe message object.
Details
Fluent
This method is part of a fluent interface and will return the same instance  
See
 
methodprotectedsetTag(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.
Parameters
NameTypeDescription
$tagstring

The tag to set.

Returns
TypeDescription
\PEAR2\Net\RouterOS\Message | \PEAR2\Net\RouterOS\MessageThe message object.
Details
Fluent
This method is part of a fluent interface and will return the same instance  
See
 
Documentation was generated by phpDocumentor 2.1.0-DEV .