2017 © Pedro Peláez
 

symfony1-plugin sy-mongodb-odm-plugin

symfony 1.x plugin for symflo/mongodb-odm.

image

symflo/sy-mongodb-odm-plugin

symfony 1.x plugin for symflo/mongodb-odm.

  • Tuesday, August 20, 2013
  • by symflo
  • Repository
  • 1 Watchers
  • 1 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

syMongodbOdmPlugin

use MongoDB ODM for PHP for SF1., (*1)

Requirements

Installation

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
      ...

Configuration

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'

In your Action

getService('symflo.mongodbodm.document.manager');
    $users = $dm->getCollection('users')->find();
}

//...
?>

Ensure Index Task

Prepare document indexes like MongoDB ODM for PHP. Then run task:, (*7)

php symfony sy:syMongodbOdmEnsureIndex

The Versions

20/08 2013

dev-master

9999999-dev

symfony 1.x plugin for symflo/mongodb-odm.

  Sources   Download

MIT

The Requires

 

by Avatar symflo

mongodb database symfony odm persistence