PEAR2_Net_RouterOS  1.0.0b5
A MikroTik RouterOS client
 All Data Structures Namespaces Files Functions Variables Pages
Response Class Reference
+ Inheritance diagram for Response:
+ Collaboration diagram for Response:

Public Member Functions

 __construct (Communicator $com, $asStream=false, $sTimeout=0, $usTimeout=null, Registry $reg=null)
 Extracts a new response from a communicator. More...
 
 getType ()
 Gets the response type. More...
 
 getArgument ($name)
 Gets the value of an argument. More...
 
 getProperty ($name)
 Gets the value of a property. More...
 
 getUnrecognizedWords ()
 Gets a list of unrecognized words. More...
 
 count ($mode=COUNT_NORMAL)
 Counts the number of arguments or words. More...
 
- Public Member Functions inherited from Message
 __invoke ($name=null)
 A shorthand gateway. More...
 
 getTag ()
 Gets the tag that the message is associated with. More...
 
 getIterator ()
 Gets all arguments in an array. More...
 
 count ($mode=COUNT_NORMAL)
 Counts the number of arguments. More...
 

Data Fields

const TYPE_FINAL = '!done'
 The last response for a request. More...
 
const TYPE_DATA = '!re'
 A response with data. More...
 
const TYPE_ERROR = '!trap'
 A response signifying error. More...
 
const TYPE_FATAL = '!fatal'
 A response signifying a fatal error, due to which the connection would be terminated. More...
 

Protected Member Functions

 setType ($type)
 Sets the response type. More...
 
- Protected Member Functions inherited from Message
 setTag ($tag)
 Sets the tag to associate the request with. More...
 
 getAttribute ($name)
 Gets the value of an attribute. More...
 
 setAttribute ($name, $value= '')
 Sets an attribute for the message. More...
 
 removeAllAttributes ()
 Removes all attributes from the message. More...
 

Protected Attributes

 $unrecognizedWords = array()
 
- Protected Attributes inherited from Message
 $attributes = array()
 

Additional Inherited Members

- Static Public Member Functions inherited from Message
static sanitizeAttributeName ($name)
 Sanitizes a name of an attribute (message or query one). More...
 
static sanitizeAttributeValue ($value)
 Sanitizes a value of an attribute (message or query one). More...
 

Detailed Description

Definition at line 42 of file Response.php.

Constructor & Destructor Documentation

__construct ( Communicator  $com,
  $asStream = false,
  $sTimeout = 0,
  $usTimeout = null,
Registry  $reg = null 
)

Extracts a new response from a communicator.

Parameters
Communicator$comThe communicator from which to extract the new response.
bool$asStreamWhether to populate the argument values with streams instead of strings.
int$sTimeoutIf a response is not immediatly available, wait this many seconds. If NULL, wait indefinetly.
int$usTimeoutMicroseconds to add to the waiting time.
Registry$regAn optional registry to sync the response with.
See also
getType()
getArgument()

Definition at line 92 of file Response.php.

Member Function Documentation

count (   $mode = COUNT_NORMAL)

Counts the number of arguments or words.

Parameters
int$modeThe counter mode. Either COUNT_NORMAL or COUNT_RECURSIVE. When in normal mode, counts the number of arguments. When in recursive mode, counts the number of API words.
Returns
int The number of arguments/words.

Definition at line 327 of file Response.php.

getArgument (   $name)

Gets the value of an argument.

Parameters
string$nameThe name of the argument.
Returns
string|resource|null The value of the specified argument. Returns NULL if such an argument is not set.
Deprecated:
1.0.0b5 Use static::getProperty() instead. This method will be removed upon final release, and is currently left standing merely because it can't be easily search&replaced in existing code, due to the fact the name "getArgument()" is shared with Request::getArgument(), which is still valid.

Definition at line 283 of file Response.php.

getProperty (   $name)

Gets the value of a property.

Parameters
string$nameThe name of the property.
Returns
string|resource|null The value of the specified property. Returns NULL if such a property is not set.

Definition at line 302 of file Response.php.

getType ( )

Gets the response type.

Returns
string The response type.
See also
setType()

Definition at line 264 of file Response.php.

getUnrecognizedWords ( )

Gets a list of unrecognized words.

Returns
array The list of unrecognized words.

Definition at line 312 of file Response.php.

setType (   $type)
protected

Sets the response type.

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

Parameters
string$typeThe new response type.
Returns
$this The response object.
See also
getType()

Definition at line 239 of file Response.php.

Field Documentation

$unrecognizedWords = array()
protected

Definition at line 69 of file Response.php.

const TYPE_DATA = '!re'

A response with data.

Definition at line 53 of file Response.php.

const TYPE_ERROR = '!trap'

A response signifying error.

Definition at line 58 of file Response.php.

const TYPE_FATAL = '!fatal'

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

Definition at line 64 of file Response.php.

const TYPE_FINAL = '!done'

The last response for a request.

Definition at line 48 of file Response.php.


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