Jun 10
been using Doctrine 1.2 successfully for my previous projects and I
figured this would be a good time as any to start. This will be a series of posts that chronicle how I build a simple
blogging site using Doctrine 2.0 primarily. Since I use a ZF and ExtJS a lot, this tutorial will be slanted to
those frameworks. I'm not going to hold your hand the entire way, this series assumes
that you've developed using ZF before. If not, go somewhere else and
learn that first. Setup your typical ZF 1.10 project and in the library directory, add
the Doctrine libs. Download Symfony 2.0 preview and replace the
vendor/Symfony directory with that. Look at the library directory on the github repository of this series
http://github.com/bzarzuela/Doctrine-2-Blog-Example for details. When you've got all that setup, the first thing you need to do is
modify config.ini. As you can see, I've changed the default inheritance of ZF to what I
think is better. The important thing to note here is that you're
adding the Doctrine namespace to the autoloader and setting up the
doctrine configuration options. Edit the bootstrap.php file to look like this Remember that ZF doesn't automatically create a proxies directory for
you and that you'll have to have APC installed. Create the BlogController.php file with the following contents. Note that in this revision, the index action is doing the DQL and
that's not a good thing. We'll fix it in the next revision with
something like D2Test_Model_Post::findAll() To get this running, execute the doctrine script in the scripts folder
with this: doctrine orm:schema-tool:create Oh yeah, you'll have to create the database first dummy. Next time, we'll integrate cli-config.php with ZF's bootstrap and fix
up the strategy. It's only been a few hours since I started this and I
have a lot of ideas on how to integrate ZF and Doctrine 2 properly.
Doctrine 2.0 and Zend Framework 1.10 Blog Project
A few hours ago, I've decided to start learning Doctrine 2.0. I'vebeen using Doctrine 1.2 successfully for my previous projects and I
figured this would be a good time as any to start. This will be a series of posts that chronicle how I build a simple
blogging site using Doctrine 2.0 primarily. Since I use a ZF and ExtJS a lot, this tutorial will be slanted to
those frameworks. I'm not going to hold your hand the entire way, this series assumes
that you've developed using ZF before. If not, go somewhere else and
learn that first. Setup your typical ZF 1.10 project and in the library directory, add
the Doctrine libs. Download Symfony 2.0 preview and replace the
vendor/Symfony directory with that. Look at the library directory on the github repository of this series
http://github.com/bzarzuela/Doctrine-2-Blog-Example for details. When you've got all that setup, the first thing you need to do is
modify config.ini. As you can see, I've changed the default inheritance of ZF to what I
think is better. The important thing to note here is that you're
adding the Doctrine namespace to the autoloader and setting up the
doctrine configuration options. Edit the bootstrap.php file to look like this Remember that ZF doesn't automatically create a proxies directory for
you and that you'll have to have APC installed. Create the BlogController.php file with the following contents. Note that in this revision, the index action is doing the DQL and
that's not a good thing. We'll fix it in the next revision with
something like D2Test_Model_Post::findAll() To get this running, execute the doctrine script in the scripts folder
with this: doctrine orm:schema-tool:create Oh yeah, you'll have to create the database first dummy. Next time, we'll integrate cli-config.php with ZF's bootstrap and fix
up the strategy. It's only been a few hours since I started this and I
have a lot of ideas on how to integrate ZF and Doctrine 2 properly.
