Cannot use a scalar value as an array when doing two or more left joins

The Class

class Places extends \Phalcon\Mvc\Model
 public function getValuesById($id=null){
        $dataset = $this->query()
            ->leftJoin('States', 's.state_id = Places.fk_state_id', 's')
            ->where('place_id = :id:',array("id" => $id),'int')

The Call

$placeObject= New Places();

The Error (it is printed 16 times)

Notice: Cannot use a scalar value as an array in C:\www\\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())


edited Mar '14

Hi, I have the same error, although a little different situation. A inner join B and B inner join C. Have you found a solution, because I think the problem might be the same?


         $drivers = parent::query()
                ->columns(array('status', 'color'))
                ->where('id_driver_to_car = :id:')
                ->innerJoin('Gtn\Model\Car', 'Gtn\Model\Drivertocar.id_car = Gtn\Model\Car.id_car')
                ->innerJoin('Gtn\Model\Car.Gtn\Model\CarDocument','Gtn\Model\Car.id_car_document = Gtn\Model\Cardocument.id_car_document')

        return $drivers;


@mullermx I have the same issue. Have you opened a bug report on Github. It is a critial bug.