Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

$rowset->current() return false instead of null when no data found #51

Closed
samsonasik opened this issue Nov 26, 2015 · 0 comments
Closed

Comments

@samsonasik
Copy link
Contributor

For example, I have the following codes:

use Zend\Db\TableGateway\TableGateway;
use Zend\Stdlib\Hydrator\ObjectProperty;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\Adapter\Adapter;

require 'vendor/autoload.php';

$adapter = new Adapter(array(
    'driver'   => 'pdo_mysql',
    'database' => 'db-album',
    'username' => 'root',
    'password' => ''
));


//using TableGateway instance
$sampleTable = new TableGateway('album', $adapter, null,new ResultSet());
//selecting...
$rowset = $sampleTable->select(array('artist' => 'Non-existent'));
$row = $rowset->current();

var_dump($row); // return false

While in code, it should be return array|\ArrayObject|null , see https://github.com/zendframework/zend-db/blob/master/src/ResultSet/ResultSet.php#L95

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant