File tree Expand file tree Collapse file tree 3 files changed +4
-26
lines changed Expand file tree Collapse file tree 3 files changed +4
-26
lines changed Original file line number Diff line number Diff line change 7575 */
7676 'mapping_types ' => [
7777 //'enum' => 'string'
78- ],
78+ ]
7979 ]
8080 ],
8181 /*
106106 | Doctrine custom types
107107 |--------------------------------------------------------------------------
108108 |
109- | Create a custom Local Type
109+ | Create a custom or override a Doctrine Type
110110 |--------------------------------------------------------------------------
111111 */
112112 'custom_types ' => [
Original file line number Diff line number Diff line change @@ -383,13 +383,9 @@ protected function getConnectionDriver(array $settings = [])
383383 */
384384 protected function registerMappingTypes (array $ settings = [], EntityManagerInterface $ manager )
385385 {
386- $ platform = $ manager ->getConnection ()->getDatabasePlatform ();
387-
388386 foreach (array_get ($ settings , 'mapping_types ' , []) as $ dbType => $ doctrineType ) {
389- // Throw DBALException if Database Type is not found.
390- $ platform ->getDoctrineTypeMapping ($ dbType );
391387 // Throw DBALException if Doctrine Type is not found.
392- $ platform ->registerDoctrineTypeMapping ($ dbType , $ doctrineType );
388+ $ manager -> getConnection ()-> getDatabasePlatform () ->registerDoctrineTypeMapping ($ dbType , $ doctrineType );
393389 }
394390 }
395391}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class EntityManagerFactoryTest extends PHPUnit_Framework_TestCase
3838 protected $ config ;
3939
4040 /**
41- * @var CacheManager
41+ * @var ConnectionManager
4242 */
4343 protected $ connection ;
4444
@@ -463,24 +463,6 @@ public function test_can_set_repository_factory()
463463 $ this ->assertEntityManager ($ manager );
464464 }
465465
466- public function test_can_register_mapping_types ()
467- {
468- $ this ->disableDebugbar ();
469- $ this ->disableSecondLevelCaching ();
470- $ this ->disableCustomCacheNamespace ();
471- $ this ->disableCustomFunctions ();
472- $ this ->enableLaravelNamingStrategy ();
473-
474- $ this ->settings ['mapping_types ' ] = [
475- 'enum ' => 'string '
476- ];
477-
478- $ manager = $ this ->factory ->create ($ this ->settings );
479-
480- $ this ->assertEntityManager ($ manager );
481- $ this ->assertTrue (array_key_exists ('string ' , $ manager ->getConnection ()->getDatabasePlatform ()->getDoctrineTypeMapping ('enum ' )));
482- }
483-
484466 /**
485467 * MOCKS
486468 */
You can’t perform that action at this time.
0 commit comments