Zend_Db Insert and Read




Zend Screencasts: Video Tutorials about the Zend PHP Framework  (iphone) show

Summary: <p>This video is the first in a series on Zend_Db. I start with a looking at insert and read using the Zend_Db_Table classes with a bit of Zend_Db_Select thrown in at the end. Next week will be a followup with update and delete with the help of a custom route, some view partials and a few more additions to our service layer. I’m not a fan of putting business logic in the same object as a class belonging to the Table Data Gateway pattern, so I’ve created a custom UserService object to help seperate the view and model layers. This would also be in keeping if you had multiple service layers (for example, a database, a couple RSS feeds and a couple of web services) and wanted to keep their business logic and querying outside of the Controller. I don’t bother with Zend_Form since it’s configuration heavy and only really interesting in conjunction with validators, however it would fit in perfectly as an extension to this project. The <a href="http://code.google.com/p/zendcasts/source/browse/#svn/trunk/ep18-create-read-intro-with-zend-table">code can be downloaded for this and next weeks episode</a> to help you follow along.</p>