forked from Baachi/nutwerk-orm-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
angun33/nutwerk-orm-extension
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Doctrine ORM Service Provider 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\Provider\DoctrineORMServiceProvider(), 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', )), )); Note: the db.orm.class_path parameter is optional (useful if you'd like to use another class loading mechanism than the one provided by Silex). By default this setup assumes you put your entities beneath app/Entity/* The EntityManager will be available by $app['db.orm.em'] By default the ArrayCache is used for doctrine caching. This may only be useful in development, so if you want to use another cache you can set it by adding the correspondig config key: 'db.orm.cache' => new Doctrine\Common\Cache\ApcCache(),
About
Doctrine ORM Extension for Silex
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published