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 Responses to “Jason Grimes: Using Doctrine 2 in Zend Framework 2”

  1. 1 Alessio

    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!

  2. 2 Rob...

    Thanks for letting me know Alessio!

    Regards,

    Rob...

The views expressed in these comments are not the views of the publisher. However, we believe in the rights of others to express their legitimate views and concerns. Any legitimate complaint emailed to rob@akrabat.com will be seriously considered and the post reviewed as desirable and necessary.

Leave a Reply

Buy now!