Integrate Doctrine with Zend Framework 1.8 app

前端 未结 3 680
夕颜
夕颜 2021-01-13 17:24

I\'m interested in using Doctrine as an ORM for a new Zend Framework app I\'m writing. I\'m trying to figure out the best way to integrate it as straightforward as possible.

3条回答
  •  醉梦人生
    2021-01-13 18:24

    As far as auto-loading is concerned, you can actually use the Doctrine loader with the new Zend_Loader_Autoloader stack quite easily. Take a look at this page, especially where it mentions the pushAutoloader() method.

    Here's the basic run down, though:

    $autoloader = Zend_Loader_Autoloader->getInstance();
    $autoloader->pushAutoloader(array('Doctrine', 'autoload'), 'Doctrine');
    

    This will use Doctrine's own autoloader for only classes that begin with Doctrine, if they are not already found by other autoloaders in the stack.

    Hope this helps a bit.

提交回复
热议问题