@@ -21,11 +21,10 @@ Requirements
2121 * PHP 5.3+
2222 * Doctrine ~ 2.3
2323
24- The [ Doctrine Service Provider] [ 1 ] (or something looking a whole lot
25- like it) ** must** be available in order for Doctrine ORM Service
26- Provider to function properly. Currently requires both ** dbs** and
27- ** dbs.event_manager** services in order to work. If you can or want
28- to fake it, go for it. :)
24+ Currently requires both ** dbs** and ** dbs.event_manager** services in
25+ order to work. These can be provided by a Doctrine Service Provider
26+ like the [ Silex] [ 1 ] or [ Cilex] [ 8 ] service providers. If you can or
27+ want to fake it, go for it. :)
2928
3029
3130Optional Dependencies
@@ -51,6 +50,17 @@ To get up and running, register `DoctrineOrmServiceProvider` and
5150manually specify the directory that will contain the proxies along
5251with at least one mapping.
5352
53+ In each of these examples an Entity Manager that is bound to the
54+ default database connection will be provided. It will be accessible
55+ via ** orm.em** .
56+
57+ ``` php
58+ <?php
59+
60+ // Default entity manager.
61+ $em = $app['orm.em'];
62+ ```
63+
5464### Pimple
5565
5666``` php
@@ -111,7 +121,7 @@ use Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
111121use Silex\Application;
112122use Silex\Provider\DoctrineServiceProvider;
113123
114- $app = new Applicaton ;
124+ $app = new Application ;
115125
116126$app->register(new DoctrineServiceProvider, array(
117127 "db.options" => array(
@@ -153,16 +163,27 @@ $app->register(new DoctrineOrmServiceProvider, array(
153163));
154164```
155165
156- This will provide access to an Entity Manager that is bound to
157- the default database connection. It is accessible via ** orm.em** .
166+ ### Cilex
158167
159168``` php
160169<?php
161170
162- // Default entity manager.
163- $em = $app['orm.em'];
171+ use Dflydev\Cilex\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
172+ use Cilex\Application;
173+ use Cilex\Provider\DoctrineServiceProvider;
174+
175+ $app = new Application('My Application');
176+
177+ $app->register(new DoctrineServiceProvider, array(
178+ /** same as the Silex example **/
179+ ));
180+
181+ $app->register(new DoctrineOrmServiceProvider, array(
182+ /** same as the Silex example **/
183+ ));
164184```
165185
186+
166187Configuration
167188-------------
168189
@@ -359,6 +380,7 @@ Some inspiration was also taken from [Doctrine Bundle][4] and
359380[ 5 ] : https://github.com/symfony/symfony/tree/master/src/Symfony/Bridge/Doctrine
360381[ 6 ] : http://github.com/dflydev/dflydev-psr0-resource-locator-service-provider
361382[ 7 ] : https://packagist.org/packages/dflydev/doctrine-orm-service-provider
383+ [ 8 ] : https://github.com/Cilex/Cilex/blob/master/src/Cilex/Provider/DoctrineServiceProvider.php
362384
363385[ #dflydev ] : irc://irc.freenode.net/#dflydev
364386[ #silex-php ] : irc://irc.freenode.net/#silex-php
0 commit comments