zend-db
zend-db copied to clipboard
AbstractResultSet::current() change breaks consistency
AbstractResultSet::current() can buffer non-valid data.
Similar example as in #51:
use Zend\Db\Adapter\Adapter;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;
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'));
$rowset->buffer();
var_dump($rowset->current()); // null
var_dump($rowset->current()); // false