The Class
class Places extends \Phalcon\Mvc\Model
{
public function getValuesById($id=null){
$dataset = $this->query()
->leftJoin('Cities','c.city_id=Places.fk_city_id','c')
->leftJoin('States', 's.state_id = Places.fk_state_id', 's')
->where('place_id = :id:',array("id" => $id),'int')
->execute();
}
}
The Call
$placeObject= New Places();
$placeObject->getValuesById($this->dispatcher->getParam("id",'int'));
The Error (it is printed 16 times)
Notice: Cannot use a scalar value as an array in C:\www\mexicohermoso.com\thor\app\models\Places.php on line 37
The Exception
PhalconException: Scanning error before '] JOIN [] JOIN [...' when parsing: SELECT [Places].* FROM [Places] LEFT JOIN [Cities] AS [c] ON c.city_id=Places.fk_city_id JOIN [] JOIN [] JOIN [] JOIN [] WHERE place_id = :id: (142)
More Details>
If I remove the States left Join, it will work just fine, also it will work flawlessly if it is executed from within the controller ($this->modelsManager->createBuilder())
ideas?