About Chris Morrell

I am a Philadelphia web designer and developer who focuses on PHP development and usable design. I am also the Director of IT for the International Association of Certified Home Inspectors.

Please Note: My site fell victim to a Wordpress security flaw a few weeks ago, and I'm just getting everything back to normal. Please bear with me.

I am currently not accepting any new clients.

Other Sites/Clients

Contact Me

If you need to get in touch with me, my name is Chris and my domain name is cmorrell.com. Think about it.

More PHP Modeling (w/ video demo)

Posted by Chris Morrell on December 4th, 2009 in Web Development, Zend Framework

[Updated with follow-up video]

About a month ago I posted some ideas about PHP modeling in the Zend Framework and requested feedback. After a month of on-and-off discussions through this website and #zftalk I decided to sit down and implement things a little more.

I now have some working base classes that can be found on GitHub. Right now I’m still thinking things out, so there’s no guarantee that’s the structure I’m going to finish with, but it’s what I’m playing with right now. So far I’ve dropped the DAO interface and the Galahad_Service parent class all together (since both are going to be pretty unique to your application). What’s left is mostly the Entity class and the DataMapper class (as well as a very generic Collection class).

I’ve also started to write some tooling for my modeling system, based on Zend_Tool. Right now it’s generating the model itself, a DAO based on Zend_Db_Table and a Zend_Form (see Matthew Weier O’Phinney’s post about using forms in your models for my reasoning there). It doesn’t generate the DataMapper yet, but that’s just a matter of writing the code…

Again, I’d love some feedback on the direction this is going. Check out the video below and then let me know. Comment below, email me at *****@cmorrell.com or get in touch on Twitter: @inxilpro.

[View full size, or watch below]

Follow-up Video (demo of a lot more code):

2 Comments »

2 Responses to “More PHP Modeling (w/ video demo)”

  1. Slavi

    Regarding db tables I’d use Default_Model_Db_Table_User i.e. “Db_Table_User” instead of DbTable_User this will match ZF conventions.

    Slavi

  2. Chris Morrell

    Actually, if you look at the existing autoloader code, the ZF convention is to use DbTable, not Db_Table.

Leave a Reply

Additional comments powered by BackType

Comments & Trackbacks

You can leave a response, or trackback from your own site. Follow any responses to this entry through the RSS 2.0 feed.

More...

@inxilpro

  • Nice! Google Maps now does biking directions! 1 day ago
  • Updated my Flickr/Tweetie bridge w/ a few more options. Lets you use flic.kr URLs in Tweetie 2. http://bit.ly/c0PEIm 3 days ago
  • I'm so goddamn sick of web site password restrictions. You're Bank of America, but you can't handle special characters in my password? 3 days ago
  • More updates...
Copyright © Chris Morrell, Powered by WordPress, Entry RSS Feed / Comment RSS Feed