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:
parent
38fec33849
commit
0916f57ce8
|
@ -39,7 +39,23 @@ class Query extends SimpleQuery
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Automagic string casting
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
|
{
|
||||||
|
return $this->toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render query string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function toString()
|
||||||
{
|
{
|
||||||
if ($this->table === null) {
|
if ($this->table === null) {
|
||||||
throw new IcingaException('Table is required');
|
throw new IcingaException('Table is required');
|
||||||
|
|
Loading…
Reference in New Issue