Introducing Doctrine 1.2 Integration




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

Summary: <p>By popular demand, I’ve put together an introduction to Doctrine 1.2 integration with the Zend Framework. Doctrine is a fantastic ORM (object-relational mapping tool). If you’ve jumped from NHibernate or Hibernate and are itching to have a powerful tool for handling database relationships, Doctrine is probably your best bet. On the mailing lists, there’s a lot of talk about integrating Doctrine 2.0 into the 2.0 release of the Zend Framework. Regardless, this will help you get up to speed today. In next week’s video, I’ll show you how you can unit test those models in the Zend Framework.</p> <p>Enjoy!</p> <p><strong>Edit:</strong> I spoke to Guilherme Blanco (one of the core developers behind Doctrine) and he kindly brought up some things I should bear in mind for my Doctrine / Zend set.<br> Doctrine’s autoloader configuration <a href="http://www.doctrine-project.org/upgrade/1_2#PEAR%20Style%20Model%20Loading%20and%20Generation">can be scaled back by doing PEAR style Model Loading (new to 1.2)</a>. Also, you can use Doctrine_Core instead of Doctrine since everything has been moved to Doctrine_Core in order to follow Zend-style namespacing.</p> <p>lastly, you can register your own CLI tasks as part of Doctrine’s CLI script or just write them in the scripts/doctrine.php file. With this, you could have your newly-generated models placed in the necessary folders. I’ll be experimenting with this in the coming week.</p> <p>Grab a <a href="http://zendcasts.googlecode.com/svn/trunk/zc38-introducing-doctrine1-2/zc38-introducing-doctrine1-2.zip">copy of the project</a> or <a href="http://code.google.com/p/zendcasts/source/browse/trunk/zc38-introducing-doctrine1-2/">browse the repository</a>.</p>