dev-master
9999999-devsymfony 1.x plugin for symflo/mongodb-odm.
MIT
The Requires
- composer/installers *
- symflo/mongodb-odm dev-master
- symflo/sy-dependency-injection-plugin dev-master
by symflo
mongodb database symfony odm persistence
symfony 1.x plugin for symflo/mongodb-odm.
use MongoDB ODM for PHP for SF1., (*1)
Add autoload Composer on your symfony project.
In the config/ProjectConfiguration.class.php
add:, (*2)
<?php require_once __DIR__.'/../vendor/autoload.php'; ?>
Add Symfony DependencyInjection Component in your composer.json
, (*3)
"require": { ... "symflo/sy-mongodb-odm-plugin": "dev-master" ... },
Activate the plugin in the config/ProjectConfiguration.class.php
., (*4)
enablePlugins(array( /* ... */ 'syMongodbOdmPlugin', )); } } ?>
And activate extension to load services in your app.yml, (*5)
syDependencyInjectionPlugin: extensions: - SyMongodbOdmExtension ...
In app.yml
:, (*6)
all: syMongodbOdmPlugin: databases: default: host: 127.0.0.1 user: '' password: '' database: database documents: user: class: 'MongoUserDocument' collectionName: 'users' collectionClass: 'MongoUserCollection' message: class: 'MongoMessageDocument' collectionName: 'messages'
getService('symflo.mongodbodm.document.manager'); $users = $dm->getCollection('users')->find(); } //... ?>
Prepare document indexes like MongoDB ODM for PHP. Then run task:, (*7)
php symfony sy:syMongodbOdmEnsureIndex
symfony 1.x plugin for symflo/mongodb-odm.
MIT
mongodb database symfony odm persistence