Developing software in the Real World

Evan Coury: Using ZendDb’s TableGateway and HydratingResultSet to return rows as custom entity/model objects

Evant Coury has posted Using ZendDb’s TableGateway and HydratingResultSet to return rows as custom entity/model objects

The new ZendDb in Zend Framework 2 has a handy feature which allows you to specify your own entity/model class to represent rows in your database tables. This means you can tell ZendDb to return each row as a populated instance of your own custom objects.

He then goes through a simple example showing how to save and load entity objects from the database.