зеркало из https://github.com/nextcloud/news.git
replace fetchRow with fetch to honour pdostatement
This commit is contained in:
Родитель
874c469e02
Коммит
2dd8827768
|
@ -80,7 +80,7 @@ class ItemMapper extends Mapper implements IMapper {
|
|||
|
||||
$params = array($userId);
|
||||
|
||||
$result = $this->execute($sql, $params)->fetchRow();
|
||||
$result = $this->execute($sql, $params)->fetch();
|
||||
|
||||
return (int) $result['size'];
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ class ItemMapper extends Mapper implements IMapper {
|
|||
$params = array($status, $threshold);
|
||||
$result = $this->execute($sql, $params);
|
||||
|
||||
while($row = $result->fetchRow()) {
|
||||
while($row = $result->fetch()) {
|
||||
|
||||
$size = (int) $row['size'];
|
||||
$limit = $size - $threshold;
|
||||
|
|
|
@ -207,12 +207,12 @@ abstract class Mapper {
|
|||
*/
|
||||
protected function findOneQuery($sql, array $params=array(), $limit=null, $offset=null){
|
||||
$result = $this->execute($sql, $params, $limit, $offset);
|
||||
$row = $result->fetchRow();
|
||||
$row = $result->fetch();
|
||||
|
||||
if($row === false || $row === null){
|
||||
throw new DoesNotExistException('No matching entry found');
|
||||
}
|
||||
$row2 = $result->fetchRow();
|
||||
$row2 = $result->fetch();
|
||||
//MDB2 returns null, PDO and doctrine false when no row is available
|
||||
if( ! ($row2 === false || $row2 === null )) {
|
||||
throw new MultipleObjectsReturnedException('More than one result');
|
||||
|
@ -246,7 +246,7 @@ abstract class Mapper {
|
|||
|
||||
$entities = array();
|
||||
|
||||
while($row = $result->fetchRow()){
|
||||
while($row = $result->fetch()){
|
||||
$entities[] = $this->mapRowToEntity($row);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class ItemMapper extends \OCA\News\Db\ItemMapper {
|
|||
$params = array($status, $threshold);
|
||||
$result = $this->execute($sql, $params);
|
||||
|
||||
while($row = $result->fetchRow()) {
|
||||
while($row = $result->fetch()) {
|
||||
|
||||
$size = (int) $row['size'];
|
||||
$limit = $size - $threshold;
|
||||
|
|
|
@ -42,7 +42,7 @@ abstract class MapperTestUtility extends \PHPUnit_Framework_TestCase {
|
|||
->getMock();
|
||||
|
||||
$this->query = $this->getMock('Query', array('execute', 'bindValue'));
|
||||
$this->pdoResult = $this->getMock('Result', array('fetchRow'));
|
||||
$this->pdoResult = $this->getMock('Result', array('fetch'));
|
||||
$this->queryAt = 0;
|
||||
$this->prepareAt = 0;
|
||||
$this->iterators = array();
|
||||
|
@ -68,7 +68,7 @@ abstract class MapperTestUtility extends \PHPUnit_Framework_TestCase {
|
|||
$fetchAt = $this->fetchAt;
|
||||
|
||||
$this->pdoResult->expects($this->any())
|
||||
->method('fetchRow')
|
||||
->method('fetch')
|
||||
->will($this->returnCallback(
|
||||
function() use ($iterators, $fetchAt){
|
||||
$iterator = $iterators[$fetchAt];
|
||||
|
|
Загрузка…
Ссылка в новой задаче