Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
578f25df
Commit
578f25df
authored
Jan 11, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #60 from stefanooldeman/echo_request
fix issue #56 add toString method to request
parents
154dec54
f7e6b92f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
library/Solarium/Client/Request.php
library/Solarium/Client/Request.php
+20
-0
No files found.
library/Solarium/Client/Request.php
View file @
578f25df
...
...
@@ -385,4 +385,24 @@ class Solarium_Client_Request extends Solarium_Configurable
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment