You are here

public function EasyRdf_Sparql_Result::__toString in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Result.php \EasyRdf_Sparql_Result::__toString()

Magic method to return value of the result to string

If this is a boolean result then it will return 'true' or 'false'. If it is a bindings type, then it will dump as a text based table.

Return value

string A string representation of the result.

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Result.php, line 376

Class

EasyRdf_Sparql_Result
Class for returned for SPARQL SELECT and ASK query responses.

Code

public function __toString() {
  if ($this->type == 'boolean') {
    return $this->boolean ? 'true' : 'false';
  }
  else {
    return $this
      ->dump('text');
  }
}