PHPackages                             alexandrealmeidaferreira/doctrine-mongo-odm-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. alexandrealmeidaferreira/doctrine-mongo-odm-module

ActiveLibrary[Database &amp; ORM](/categories/database)

alexandrealmeidaferreira/doctrine-mongo-odm-module
==================================================

Zend Framework Module that provides Doctrine MongoDB ODM functionality

1.0.1(8y ago)022MITPHPPHP ^5.6 || ^7.0

Since Oct 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/alexandrealmeidaferreira/DoctrineMongoODMModule)[ Packagist](https://packagist.org/packages/alexandrealmeidaferreira/doctrine-mongo-odm-module)[ Docs](http://www.doctrine-project.org/)[ RSS](/packages/alexandrealmeidaferreira-doctrine-mongo-odm-module/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (16)Versions (17)Used By (0)

Doctrine MongoDB ODM Module for Zend Framework 2
================================================

[](#doctrine-mongodb-odm-module-for-zend-framework-2)

Master: [![Build Status](https://camo.githubusercontent.com/4516dd8b463be16f1ee228cc03fbf3f5368c42ead065bb3f80d93100322768e1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f646f637472696e652f446f637472696e654d6f6e676f4f444d4d6f64756c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/doctrine/DoctrineMongoODMModule)

The DoctrineMongoODMModule integrates Doctrine 2 MongoDB ODM with Zend Framework 2 quickly and easily. The following features are intended to work out of the box:

- MongoDB support
- Multiple document managers
- Multiple connections
- Support for using existing `Mongo` connections
- Doctrine Cli support

Requirements
------------

[](#requirements)

[Zend Framework 2 Application Skeleton](http://www.github.com/zendframework/ZendSkeletonApplication) (or compatible architecture)

Installation
------------

[](#installation)

Installation of this module uses composer. For composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).

#### Installation steps

[](#installation-steps)

1. `cd my/project/directory`
2. create a `composer.json` file with following contents:

    ```
    {
        "require": {
            "doctrine/doctrine-mongo-odm-module": "^1.0"
        }
    }
    ```
3. install composer via `curl -s http://getcomposer.org/installer | php` (on windows, download  and execute it with PHP)
4. run `php composer.phar install`
5. open `my/project/directory/configs/application.config.php` and add following keys to your `modules` (in this order)

    ```
    'DoctrineModule',
    'DoctrineMongoODMModule',
    ```
6. copy `vendor/doctrine/doctrine-mongo-odm-module/config/module.doctrine-mongo-odm.local.php.dist` into your application's `config/autoload` directory, rename it to `module.doctrine-mongo-odm.local.php` and make the appropriate changes. With this config file you can configure your mongo connection, add extra annotations to register, add subscribers to the event manager, add filters to the filter collection, and drivers to the driver chain.
7. create directory `my/project/directory/data/DoctrineMongoODMModule/Proxy` and `my/project/directory/data/DoctrineMongoODMModule/Hydrator` and make sure your application has write access to it.

Usage
-----

[](#usage)

#### Command Line

[](#command-line)

Access the Doctrine command line as following

```
./vendor/bin/doctrine-module
```

#### Service Locator

[](#service-locator)

Access the document manager using the following service manager alias:

```
