PEAR2_Net_RouterOS  1.0.0b6
A MikroTik RouterOS client
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...
 
- 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 ()
 Counts the number of attributes. More...
 

Data Fields

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

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 43 of file Response.php.

Constructor & Destructor Documentation

◆ __construct()

__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 immediately available, wait this many seconds. If NULL, wait indefinitely.
int | null$usTimeoutMicroseconds to add to the waiting time.
Registry | null$regAn optional registry to sync the response with.
See also
getType()
getArgument()

Definition at line 97 of file Response.php.

Member Function Documentation

◆ getArgument()

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 291 of file Response.php.

◆ getProperty()

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 310 of file Response.php.

◆ getType()

getType ( )

Gets the response type.

Returns
string The response type.
See also
setType()

Definition at line 271 of file Response.php.

◆ getUnrecognizedWords()

getUnrecognizedWords ( )

Gets a list of unrecognized words.

Returns
string[] The list of unrecognized words.

Definition at line 320 of file Response.php.

◆ setType()

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 245 of file Response.php.


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