\Response.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\Response

Package: PEAR2\Net\RouterOS

Represents a RouterOS response.

Parent(s)
\PEAR2\Net\RouterOS\Message
Author
Vasil Rangelov  
Category
Net  
License
LGPL License 2.1  
Link
http://netrouteros.sourceforge.net/  

Constants

Constant  TYPE_FINAL = '!done'

The last response for a request.

Constant  TYPE_DATA = '!re'

A response with data.

Constant  TYPE_ERROR = '!trap'

A response signifying error.

Constant  TYPE_FATAL = '!fatal'

A response signifying a fatal error, due to which the connection would be terminated.

Properties

Propertyprivatestring  $_type= 'null'

The response type.
Default valuenullDetails
Type
string
Propertyprotectedarray  $arguments= 'array('
inherited

An array with message arguments. Keys are the names of the arguments, array values are values for the corresponding argument.Inherited from: \PEAR2\Net\RouterOS\Message::$arguments
Default valuearray(Details
Type
array
Inherited_from
\PEAR2\Net\RouterOS\Message::$arguments  
Propertyprotectedarray  $unrecognizedWords= 'array('

An array of unrecognized words in network order.
Default valuearray(Details
Type
array

Methods

methodpublic__construct( \PEAR2\Net\RouterOS\Communicator $com, bool $asStream = false ) : void

Extracts a new response from a communicator.

Parameters
Name Type Description
$com \PEAR2\Net\RouterOS\Communicator

The communicator from which to extract the new response.

$asStream bool

Whether to populate the argument values with streams instead of strings.

Details
See
\PEAR2\Net\RouterOS\getType()  
See
\PEAR2\Net\RouterOS\getArgument()  
methodpublicgetAllArguments( ) : array
inherited

Gets all arguments in an array.

Inherited from: \PEAR2\Net\RouterOS\Message::getAllArguments()
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
inherited

Gets the value of an argument.

Inherited from: \PEAR2\Net\RouterOS\Message::getArgument()
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
inherited

Gets the tag that the message is associated with.

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

Gets the response type.

Returns
Type Description
string The response type.
Details
See
\PEAR2\Net\RouterOS\setType()  
methodpublicgetUnrecognizedWords( ) : array

Gets a list of unrecognized words.

Returns
Type Description
array The list of unrecognized words.
methodprotectedremoveAllArguments( ) : \PEAR2\Net\RouterOS\Message
inherited

Removes all arguments from the message.

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

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

Inherited from: \PEAR2\Net\RouterOS\Message::sanitizeArgumentName()
Parameters
Name Type Description
$name mixed

The name to sanitize.

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

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

Inherited from: \PEAR2\Net\RouterOS\Message::sanitizeArgumentValue()
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
inherited

Sets an argument for the message.

Inherited from: \PEAR2\Net\RouterOS\Message::setArgument()
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
inherited

Sets the tag to associate the request with.

Inherited from: \PEAR2\Net\RouterOS\Message::setTag()

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()  
methodprotectedsetType( string $type ) : \PEAR2\Net\RouterOS\Response

Sets the response type.

Sets the response type. Valid values are the TYPE_* constants.

Parameters
Name Type Description
$type string

The new response type.

Returns
Type Description
\PEAR2\Net\RouterOS\Response The response object.
Details
See
\PEAR2\Net\RouterOS\getType()  
Documentation was generated by DocBlox 0.14.1.