*/
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');
$entities = array();
- while($row = $result->fetchRow()){
+ while($row = $result->fetch()){
$entities[] = $this->mapRowToEntity($row);
}
->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();
* @param array $arguments the expected arguments for the prepare query
* method
* @param array $returnRows the rows that should be returned for the result
- * of the database query. If not provided, it wont be assumed that fetchRow
+ * of the database query. If not provided, it wont be assumed that fetch
* will be called on the result
*/
protected function setMapperResult($sql, $arguments=array(), $returnRows=array(),
$fetchAt = $this->fetchAt;
$this->pdoResult->expects($this->any())
- ->method('fetchRow')
+ ->method('fetch')
->will($this->returnCallback(
function() use ($iterators, $fetchAt){
$iterator = $iterators[$fetchAt];