Download the PHP package sinsquare/silex-doctrine-orm-provider without Composer
On this page you can find all versions of the php package sinsquare/silex-doctrine-orm-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sinsquare/silex-doctrine-orm-provider
More information about sinsquare/silex-doctrine-orm-provider
Files in sinsquare/silex-doctrine-orm-provider
Package silex-doctrine-orm-provider
Short Description Doctrine ORM provider for Silex framework
License MIT
Informations about the package silex-doctrine-orm-provider
Doctrine ORM provider for Silex 2.x framework
Code quality | Tests | Issues |
---|---|---|
Installation
With composer :
Registering the providers
-
If you only need the ORM without validation and web profiler
-
If you only need the ORM validation (UniqueEntity)
- If you only need the the ORM web profiler
Configuration
The configuration of the ORM must be set in $application['doctrine.orm.options'], and it must exist before registering the provider.
A basic configuration scheme:
The configuration scheme is similar to the one used in Smyfony (read more here).
-
default_entity_manager: Name of the default entity manager. If not set the first one will be the default.
-
connection: Name of the DBAL connection to use. Read more at the DoctrineServiceProvider help here.
-
mapping: Currently only the annotation type is supported by default, but you can extend the functionality. Look for $app['doctrine.orm.mappingdriver.locator'] in the DoctrineOrmServiceProvider.
-
cache: The project uses SinSquare/silex-doctrine-orm-provider for cacheing, which is a wrapper for Doctrine Cache.
- Using anonym cache:
You can change the cache type, for more info check the Doctrine Cache component. *Using named cache:
You can create new types of caches, please read how to here;
Retrieving the EntityManager
-
The default entity manager:
- A named entity manager:
Using the validator
Adding custom subscribers to the EntityManager
If you need to attach subscriber to the EntityManager you should use the $application['doctrine.orm.em_factory.postinit'] as it runs only once after the fist call on the manager.
All versions of silex-doctrine-orm-provider with dependencies
doctrine/orm Version ~2.0
silex/silex Version ~2.0
sinsquare/silex-doctrine-cache-provider Version 1.*
symfony/validator Version ~2.8|^3.0
symfony/doctrine-bridge Version ~2.8|^3.0
doctrine/doctrine-bundle Version ~1.5