Cannot access empty property in /home/bender/projects/engine/app/modules/admin/controllers/AdminController.php on line 86: Here is the method of controller:
private function getHotelsCountPerSupplier()
{
$propertySupplier = new Property\PropertySupplier();
$hotelsComplexResultSet = $propertySupplier->getHotelsCountPerSupplier();
$count = $hotelsComplexResultSet->count();
for ($i = 0; $i < $count; $i++) {
$data[] = $hotelsComplexResultSet[$i]->toArray();
}
return $data;
}
And the problem line is
$data[] = $hotelsComplexResultSet[$i]->toArray();
on the 4 iteration. hotelsComplexResultSet is a Resultset\Complex with count 10.
And here is the the model method getHotelCountPerSupplier() :
public function getHotelsCountPerSupplier()
{
$query = $this->getDI()->getModelsManager()->createQuery("SELECT * FROM \Modules\Admin\Models\Property\PropertySupplier as ps
JOIN \Modules\Admin\Models\Supplier as s ON ps.supplier_id = s.id GROUP BY s.id");
return $query->execute();
}
It looks like a bug