Commit f7e6b92f authored by stefanooldeman's avatar stefanooldeman

fix issue #56 add toString method to request

parent 154dec54
...@@ -385,4 +385,24 @@ class Solarium_Client_Request extends Solarium_Configurable ...@@ -385,4 +385,24 @@ class Solarium_Client_Request extends Solarium_Configurable
return $queryString; return $queryString;
} }
/**
* Magic method enables a object to be transformed to a string
*
* Get a summary showing significant variables in the object
* note: uri resource is decoded for readability
*
* @return string
*/
public function __toString()
{
$output = __CLASS__ . '::toString ' . " \n"
. 'method: ' . $this->getMethod() . "\n"
. 'header: ' . print_r($this->getHeaders(), 1) //don't add newline when using print_r
. 'resource: ' . urldecode($this->getUri()) . "\n"
. 'raw data: ' . $this->getRawData() . "\n";
return $output;
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment