Livestatus\Query: split string cast implementation

This way we can use an exception-throwing variant internally while not
breaking __toString
This commit is contained in:
Thomas Gelf 2014-11-16 15:13:07 +01:00
parent 38fec33849
commit 0916f57ce8
1 changed files with 16 additions and 0 deletions

View File

@ -39,7 +39,23 @@ class Query extends SimpleQuery
return $this;
}
*/
/**
* Automagic string casting
*
* @return string
*/
public function __toString()
{
return $this->toString();
}
/**
* Render query string
*
* @return string
*/
public function toString()
{
if ($this->table === null) {
throw new IcingaException('Table is required');