Developing software in the Real World

Jason Grimes: Using Doctrine 2 in Zend Framework 2

Jason Grimes has posted an article showing how to use Doctrine 2 with Zend Framework 2.

He uses my tutorial as the starting point which enables him to concentrate on the Doctrine integration rather than the irrelevant details about setting a ZF2 application which is excellent.

He walks through 6 steps in order to do the integration:

This article shows how to set up and use Doctrine 2 in Zend Framework 2, by extending Rob’s Getting Started tutorial to use Doctrine instead of Zend_Db.

  • Start with Akrabat’s tutorial
  • Install Doctrine modules
  • Configure the Album module to use Doctrine
  • Create the Album entity
  • Update the Album controller to use Doctrine instead of Zend_Db
  • That’s it!

I highly recommend having a read if you’re at all interested in using Doctrine 2 with Zend Framework 2.

2 thoughts on “Jason Grimes: Using Doctrine 2 in Zend Framework 2

  1. Hi,
    I tried to follow the tutorial of Jason Grimes and stumbled on a problem with your ZF2 tutorial.

    you are using
    $basePath = $app->getRequest()->detectBaseUrl();
    in module/Application/Module.php:79

    However since the commit bf18dbd8cad70c1f67477231c97b52165bd5a3cb you need to use:
    $basePath = $app->getRequest()->getBaseUrl();

    Nonetheless thanks for the tutorial!

Thoughts? Leave a reply

Your email address will not be published. Required fields are marked *