File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/Dflydev/Pimple/Provider/DoctrineOrm Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,8 @@ Configuration
230230 String or array describing metadata cache implementation.
231231 * ** result_cache** (Default: setting specified by orm.default_cache):
232232 String or array describing result cache implementation.
233+ * ** types**
234+ An array of custom types in the format of 'typeName' => 'Namespace\To\Type\Class'
233235 * ** orm.ems.options** :
234236 Array of Entity Manager configuration sets indexed by each Entity Manager's
235237 name. Each value should look like ** orm.em.options** .
Original file line number Diff line number Diff line change 2121use Doctrine \Common \Cache \RedisCache ;
2222use Doctrine \Common \Persistence \Mapping \Driver \MappingDriver ;
2323use Doctrine \Common \Persistence \Mapping \Driver \MappingDriverChain ;
24+ use Doctrine \DBAL \Types \Type ;
2425use Doctrine \ORM \Configuration ;
2526use Doctrine \ORM \EntityManager ;
2627use Doctrine \ORM \Mapping \Driver \Driver ;
@@ -163,6 +164,14 @@ public function register(\Pimple $app)
163164 }
164165 $ config ->setMetadataDriverImpl ($ chain );
165166
167+ foreach ((array ) $ options ['types ' ] as $ typeName => $ typeClass ) {
168+ if (Type::hasType ($ typeName )) {
169+ Type::overrideType ($ typeName , $ typeClass );
170+ } else {
171+ Type::addType ($ typeName , $ typeClass );
172+ }
173+ }
174+
166175 $ configs [$ name ] = $ config ;
167176 }
168177
You can’t perform that action at this time.
0 commit comments