Ldap/Query: re-add __toString

We stopped using __toString as it is unable to handle exceptions - and
this makes sense. However, that's IMO not a good reason to completely
drop __toString. Especially when debugging, benchmarking and similar you
often need a quick way to "dump" an object.

In that case you are often not in a mood to figure out whether that
specific class prefers create(), dump(), render() or whatever. We should
not base our view scripts on __toString - at least unless we do not catch
Exceptions in __toString methods, eventually "forwarding" them as triggered
error where needed.
This commit is contained in:
Thomas Gelf 2015-03-13 08:58:25 +01:00
parent 697d4aff27
commit 316d926811
1 changed files with 5 additions and 0 deletions

View File

@ -348,6 +348,11 @@ class Query
}
}
public function __toString()
{
return $this->create();
}
/**
* Descructor
*/