News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jonathan Wage's Blog:
Blending the Doctrine ORM and MongoDB ODM
August 26, 2010 @ 13:34:40

On his blog today Jonathan Wage has posted a tip on getting MongoDB connections and queries to work through the Doctrine ORM layer:

Since the start of the Doctrine MongoDB Object Document Mapper project people have asked how it can be integrated with the ORM. This blog post demonstrates how you can integrate the two transparently, maintaining a clean domain model. This example will have a Product that is stored in MongoDB and the Order stored in a MySQL database.

His code shows how to define the document and entity for the connection (a Product and Order) and creating an event subscriber to lazy load the product. He creates a sample Product and an Order for it and save them to the database. He also includes code to pull an order back out by its ID number and get an Order object back out (with Product data inside).

0 comments voice your opinion now!
doctrine orm mongodb document entity subscriber event tutorial


blog comments powered by Disqus

Similar Posts

DZone.com: Sencha Touch 2 Models - Loading And Saving Model Data Using a Proxy, PHP Example

DevShed: Introducing SimpleXML in PHP 5

Lorna Mitchell's Blog: PHP REST Server (Part 3 of 3)

Zend Developer Zone: Integrating Propel with the Zend Framework

PHPBuilder.com: Creating an RSS Aggregator with the PHP SimplePie Library


Community Events

Don't see your event here?
Let us know!


introduction api framework opinion series release extension community install interview library laravel xdebug language voicesoftheelephpant podcast example laravel5 php7 unittest

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework