66
77use Doctrine \ORM \EntityManager ;
88use Doctrine \ORM \EntityManagerInterface ;
9+ use Doctrine \ORM \Mapping \EntityListenerResolver ;
910use Doctrine \Persistence \Mapping \Driver \MappingDriverChain ;
1011use Dot \Cache \Adapter \ArrayAdapter ;
1112use Dot \Cache \Adapter \FilesystemAdapter ;
13+ use Light \App \Factory \EntityListenerResolverFactory ;
1214use Light \App \Factory \GetIndexViewHandlerFactory ;
1315use Light \App \Handler \GetIndexViewHandler ;
16+ use Light \App \Types \UuidType ;
1417use Mezzio \Application ;
15- use Ramsey \Uuid \Doctrine \UuidType ;
1618use Roave \PsrContainerDoctrine \EntityManagerFactory ;
1719
1820use function getcwd ;
@@ -51,6 +53,8 @@ public function getDependencies(): array
5153 'factories ' => [
5254 'doctrine.entity_manager.orm_default ' => EntityManagerFactory::class,
5355 GetIndexViewHandler::class => GetIndexViewHandlerFactory::class,
56+ EntityListenerResolver::class => EntityListenerResolverFactory::class,
57+
5458 ],
5559 'aliases ' => [
5660 EntityManager::class => 'doctrine.entity_manager.orm_default ' ,
@@ -96,12 +100,13 @@ private function getDoctrineConfig(): array
96100 ],
97101 'configuration ' => [
98102 'orm_default ' => [
99- 'result_cache ' => 'filesystem ' ,
100- 'metadata_cache ' => 'filesystem ' ,
101- 'query_cache ' => 'filesystem ' ,
102- 'hydration_cache ' => 'array ' ,
103- 'typed_field_mapper ' => null ,
104- 'second_level_cache ' => [
103+ 'entity_listener_resolver ' => EntityListenerResolver::class,
104+ 'result_cache ' => 'filesystem ' ,
105+ 'metadata_cache ' => 'filesystem ' ,
106+ 'query_cache ' => 'filesystem ' ,
107+ 'hydration_cache ' => 'array ' ,
108+ 'typed_field_mapper ' => null ,
109+ 'second_level_cache ' => [
105110 'enabled ' => true ,
106111 'default_lifetime ' => 3600 ,
107112 'default_lock_lifetime ' => 60 ,
@@ -117,6 +122,21 @@ private function getDoctrineConfig(): array
117122 'class ' => MappingDriverChain::class,
118123 ],
119124 ],
125+ 'migrations ' => [
126+ 'table_storage ' => [
127+ 'table_name ' => 'doctrine_migration_versions ' ,
128+ 'version_column_name ' => 'version ' ,
129+ 'version_column_length ' => 191 ,
130+ 'executed_at_column_name ' => 'executed_at ' ,
131+ 'execution_time_column_name ' => 'execution_time ' ,
132+ ],
133+ // Modify this line based on where you would like to have you migrations
134+ 'migrations_paths ' => [
135+ 'Migrations ' => 'src/Migrations ' ,
136+ ],
137+ 'all_or_nothing ' => true ,
138+ 'check_database_platform ' => true ,
139+ ],
120140 'types ' => [
121141 UuidType::NAME => UuidType::class,
122142 ],
0 commit comments