When attempting to present data with a filter on the data. Items are empty when displayed on view:
This is how im getting the result set:
$vehicles = Vehicles::find(array($vehicleWhere));
$paginator = new Paginator(array(
"data" => $vehicles,
"limit" => 10,
"page" => $numberPage
));
This is a vardump of the $vehicles, $numberPage, and $page.
object(stdClass)[90]
public 'items' =>
array (size=0)
empty
public 'next' => int 1
public 'first' => int 1
public 'before' => int 1
public 'current' => int 1
public 'last' => int 1
public 'total_pages' => int 1
public 'total_items' => int 5
int 1
object(Phalcon\Mvc\Model\Resultset\Simple)[84]
protected '_type' => int 0
protected '_result' =>
object(Phalcon\Db\Result\Pdo)[85]
protected '_connection' =>
object(Phalcon\Db\Adapter\Pdo\Mysql)[79]
protected '_eventsManager' =>
object(Phalcon\Events\Manager)[76]
...
protected '_descriptor' =>
array (size=4)
...
protected '_dialect' =>
object(Phalcon\Db\Dialect\Mysql)[81]
...
protected '_connectionId' => int 1
protected '_sqlStatement' => string 'SELECT `vehicles`.`Year` AS `Year` FROM `vehicles` GROUP BY `vehicles`.`Year` ORDER BY `vehicles`.`Year`' (length=104)
protected '_sqlVariables' => null
protected '_sqlBindTypes' => null
protected '_transactionsWithSavepoints' => int 0
protected '_pdo' =>
object(PDO)[80]
...
protected '_affectedRows' => null
protected '_transactionLevel' => int 0
protected '_type' => string 'mysql' (length=5)
protected '_dialectType' => string 'mysql' (length=5)
protected '_result' => null
protected '_fetchMode' => int 2
protected '_pdoStatement' =>
object(PDOStatement)[86]
public 'queryString' => string 'SELECT `vehicles`.`Id`, `vehicles`.`Vehicle_Makes_Id`, `vehicles`.`Vehicle_Models_Id`, `vehicles`.`Year` FROM `vehicles` WHERE `vehicles`.`Year` = 1998 AND `vehicles`.`Vehicle_Makes_Id` = 5' (length=189)
protected '_sqlStatement' => string 'SELECT `vehicles`.`Id`, `vehicles`.`Vehicle_Makes_Id`, `vehicles`.`Vehicle_Models_Id`, `vehicles`.`Year` FROM `vehicles` WHERE `vehicles`.`Year` = 1998 AND `vehicles`.`Vehicle_Makes_Id` = 5' (length=189)
protected '_bindParams' => null
protected '_bindTypes' => null
protected '_rowCount' => int 5
protected '_cache' => null
protected '_isFresh' => boolean true
protected '_pointer' => int 0
protected '_count' => int 5
protected '_activeRow' => boolean false
protected '_rows' =>
array (size=5)
0 =>
array (size=4)
'Id' => string '1065' (length=4)
'Vehicle_Makes_Id' => string '5' (length=1)
'Vehicle_Models_Id' => string '27' (length=2)
'Year' => string '1998' (length=4)
1 =>
array (size=4)
'Id' => string '1066' (length=4)
'Vehicle_Makes_Id' => string '5' (length=1)
'Vehicle_Models_Id' => string '28' (length=2)
'Year' => string '1998' (length=4)
2 =>
array (size=4)
'Id' => string '1067' (length=4)
'Vehicle_Makes_Id' => string '5' (length=1)
'Vehicle_Models_Id' => string '30' (length=2)
'Year' => string '1998' (length=4)
3 =>
array (size=4)
'Id' => string '1068' (length=4)
'Vehicle_Makes_Id' => string '5' (length=1)
'Vehicle_Models_Id' => string '31' (length=2)
'Year' => string '1998' (length=4)
4 =>
array (size=4)
'Id' => string '1069' (length=4)
'Vehicle_Makes_Id' => string '5' (length=1)
'Vehicle_Models_Id' => string '585' (length=3)
'Year' => string '1998' (length=4)
protected '_errorMessages' => null
protected '_hydrateMode' => int 0
protected '_model' =>
object(WP\Models\Vehicles)[72]
public 'Id' => null
public 'Vehicle_Makes_Id' => null
public 'Vehicle_Models_Id' => null
public 'Year' => null
protected '_dependencyInjector' =>
object(Phalcon\DI\FactoryDefault)[5]
public '_services' =>
array (size=27)
...
public '_sharedInstances' =>
array (size=15)
...
public '_freshInstance' => boolean true
protected '_modelsManager' =>
object(Phalcon\Mvc\Model\Manager)[70]
protected '_dependencyInjector' =>
object(Phalcon\DI\FactoryDefault)[5]
...
protected '_eventsManager' => null
protected '_customEventsManager' => null
protected '_readConnectionServices' => null
protected '_writeConnectionServices' => null
protected '_aliases' =>
array (size=2)
...
protected '_hasMany' => null
protected '_hasManySingle' => null
protected '_hasOne' => null
protected '_hasOneSingle' => null
protected '_belongsTo' =>
array (size=2)
...
protected '_belongsToSingle' =>
array (size=1)
...
protected '_hasManyToMany' => null
protected '_hasManyToManySingle' => null
protected '_initialized' =>
array (size=1)
...
protected '_sources' =>
array (size=1)
...
protected '_schemas' => null
protected '_behaviors' => null
protected '_lastInitialized' =>
&object(WP\Models\Vehicles)[72]
protected '_lastQuery' => null
protected '_reusable' => null
protected '_keepSnapshots' => null
protected '_dynamicUpdate' => null
protected '_namespaceAliases' => null
protected '_modelsMetaData' => null
protected '_errorMessages' => null
protected '_operationMade' => int 0
protected '_dirtyState' => int 1
protected '_transaction' => null
protected '_uniqueKey' => null
protected '_uniqueParams' => null
protected '_uniqueTypes' => null
protected '_skipped' => null
protected '_related' => null
protected '_snapshot' => null
protected '_columnMap' => null
protected '_keepSnapshots' => boolean false