gigablah / fsphinxphp

PHP Sphinx API extension for faceted search.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Call to undefined method FSphinx\MultiFieldQuery::toString() [two underscores]

syrsly opened this issue · comments

This is more or less just me bickering about underscores. I didn't notice them for a while. It should be two underscores before toString function to make it work. This function should be renamed to something easier to figure out, because those two underscores really threw me for a loop!

__toString() is a PHP "magic method":
http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring

So you don't actually need to explicitly call __toString():

$query = new MultiFieldQuery();
$query->parse('@year 1974');
echo $query;