forked from mjakubowski/nutwerk-orm-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
32 lines (23 loc) · 1.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Doctrine ORM Extension for Silex
================================
This extension sets up Doctrine ORM for Silex by reusing the database connection established with the DBAL extension.
Installation
------------
cd /path/to/silex_project/vendor
git clone [email protected]:mjakubowski/nutwerk-orm-extension.git
Download Doctrine ORM package to /path/to/silex_project/vendor/doctrine2-orm
Edit your index.php:
$app['autoloader']->registerNamespace('Nutwerk', __DIR__.'/vendor/nutwerk-orm-extension/lib');
$app->register(new Nutwerk\Extension\DoctrineORMExtension(), array(
'db.orm.class_path' => __DIR__.'/vendor/doctrine2-orm/lib',
'db.orm.proxies_dir' => __DIR__.'/var/cache/doctrine/Proxy',
'db.orm.proxies_namespace' => 'DoctrineProxy',
'db.orm.auto_generate_proxies' => true,
'db.orm.entities' => array(array(
'type' => 'annotation',
'path' => __DIR__.'/app',
'namespace' => 'Entity',
)),
));
By default this setup assumes you put your entities beneath app/Entity/*
The EntityManager will be available by $app['db.orm.em']