Issues

ZF-4486: PDOStatement is of type Traversable, Zend_Db_Statement should be an Iterator

Issue Type:

Improvement

Created:

2008-10-04T11:55:40.000+0000

Last Updated:

2008-12-22T00:34:38.000+0000

Status:

Resolved

Fix version(s):

1.8.0 (30/Apr/09)

Reporter:

exceptione (exceptione)

Assignee:

Ralph Schindler (ralph)

Tags:

Zend_Db

Related issues:

Attachments:

Description

PDOStatement has type Traversable. This is a php-internal type.
To my surprise Zend_Db_Statement doesn't expose this interface. I expect at least Zend_Db_Statement_Pdo to be iterative.
Iterator extends Traversable and this interface can be used in userland code. Implementing the Iterator interface for Zend_Db_Statement would solve this discrepancy. We can throw an NotImplementedException for rewind().

Comments

Posted by julien PAULI (doctorrock83) on 2008-11-27T08:01:24.000+0000

Perhaps we could use IteratorAggregate.

The getIterator() method could then return the PDOStatement, as return $this->_stmt