- md5
- a048383a7270024b46d16983bc78035e
- sha1
- 2598978d434c49c2dd766b721af80e2107d5386f
- sha256
- b95a0de857db959b475c52aac9a877687afa5ebab29e74955173c82aaec415bc
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
<?php
/**
* @package FrameworkOnFramework
* @subpackage database
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects
* instead of plain stdClass objects
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
/**
* PDO database iterator.
*/
class FOFDatabaseIteratorPdo extends FOFDatabaseIterator
{
/**
* Get the number of rows in the result set for the executed SQL given by the cursor.
*
* @return integer The number of rows in the result set.
*
* @see Countable::count()
*/
public function count()
{
if (!empty($this->cursor) && $this->cursor instanceof PDOStatement)
{
return @$this->cursor->rowCount();
}
else
{
return 0;
}
}
/**
* Method to fetch a row from the result set cursor as an object.
*
* @return mixed Either the next row from the result set or false if there are no more rows.
*/
protected function fetchObject()
{
if (!empty($this->cursor) && $this->cursor instanceof PDOStatement)
{
return @$this->cursor->fetchObject($this->class);
}
else
{
return false;
}
}
/**
* Method to free up the memory used for the result set.
*
* @return void
*/
protected function freeResult()
{
if (!empty($this->cursor) && $this->cursor instanceof PDOStatement)
{
@$this->cursor->closeCursor();
}
}
}
The same content is in 151 releases, Joomla 3.6.3-rc1 to 3.10.12. See them all, or every version of this file.