This works and shows the result set:
$mainFeatures = new Mainfeature;
$mainFeatures->getConnection()->setFetchMode(PDO::FETCH_KEY_PAIR);
$main = $mainFeatures::get(array('id','data'))->toArray();
dd($main);
But if i try to return with the result set:
return View::make('orders.create')
->with('features', Feature::with('Subfeature')->get()->toArray())
->with('mainFeatures', $main);
It gives an error:
SQLSTATE[HY000]: General error: PDO::FETCH_KEY_PAIR fetch mode requires the result set to contain extactly 2 columns. (SQL: select * from `features`) (Bindings: array ( ))
Not sure from where select * from features
comes in...