Listing B Using iteration with Zend Db Table Rowset

class Users extends Zend_Db_Table {} $users = new Users();

foreach ($userRowset as $user) { < echo $user->name . "\n";

Gets rowset

Iterates over rowset class

Defines gateway class to Users database table

As we'd expect, using a rowset is as easy as using an array. This is possible because Zend_Db_Table_Rowset_Abstract implements the Iterator SPL interface, as shown in listing B.12.

0 0

Post a comment

  • Receive news updates via email from this site