|
32 | 32 | use App\Core\ServiceFactory\RequestHandler\PingRequestHandlerFactory; |
33 | 33 | use App\Pet\Model\Pet; |
34 | 34 | use App\Pet\Model\Vaccination; |
35 | | -use App\Pet\Orm\PetMapping; |
36 | | -use App\Pet\Orm\VaccinationMapping; |
| 35 | +use App\Pet\Odm\PetMapping; |
| 36 | +use App\Pet\Odm\VaccinationMapping; |
37 | 37 | use App\Pet\Parsing\PetParsing; |
38 | 38 | use App\Pet\Repository\PetRepository; |
39 | 39 | use App\Pet\ServiceFactory\Framework\PetRoutesDelegator; |
|
59 | 59 | use Chubbyphp\Framework\Router\RoutesByNameInterface; |
60 | 60 | use Chubbyphp\Framework\Router\UrlGeneratorInterface; |
61 | 61 | use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\Common\Cache\ApcuAdapterFactory; |
62 | | -use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\DBAL\ConnectionFactory; |
63 | | -use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\DBAL\Tools\Console\ContainerConnectionProviderFactory; |
64 | | -use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\EntityManagerFactory; |
65 | | -use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\ContainerEntityManagerProviderFactory; |
| 62 | +use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ODM\MongoDB\DocumentManagerFactory; |
66 | 63 | use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\Persistence\Mapping\Driver\ClassMapDriverFactory; |
67 | 64 | use Chubbyphp\Negotiation\AcceptNegotiatorInterface; |
68 | 65 | use Chubbyphp\Negotiation\ContentTypeNegotiatorInterface; |
|
73 | 70 | use Chubbyphp\Negotiation\ServiceFactory\ContentTypeMiddlewareFactory; |
74 | 71 | use Chubbyphp\Negotiation\ServiceFactory\ContentTypeNegotiatorFactory; |
75 | 72 | use Chubbyphp\Parsing\ParserInterface; |
76 | | -use Doctrine\DBAL\Connection; |
77 | | -use Doctrine\DBAL\Tools\Console\ConnectionProvider; |
78 | | -use Doctrine\DBAL\Tools\DsnParser; |
79 | | -use Doctrine\ORM\EntityManager; |
80 | | -use Doctrine\ORM\EntityManagerInterface; |
81 | | -use Doctrine\ORM\Tools\Console\EntityManagerProvider; |
| 73 | +use Doctrine\ODM\MongoDB\DocumentManager; |
82 | 74 | use Doctrine\Persistence\Mapping\Driver\MappingDriver; |
83 | 75 | use Monolog\Level; |
84 | 76 | use Psr\Cache\CacheItemPoolInterface; |
|
105 | 97 | ], |
106 | 98 | 'debug' => false, |
107 | 99 | 'dependencies' => [ |
108 | | - 'aliases' => [ |
109 | | - EntityManager::class => EntityManagerInterface::class, |
110 | | - ], |
111 | 100 | 'factories' => [ |
112 | 101 | AcceptMiddleware::class => AcceptMiddlewareFactory::class, |
113 | | - AcceptNegotiatorInterface::class => AcceptNegotiatorFactory::class, |
114 | 102 | AcceptNegotiatorInterface::class.'supportedMediaTypes[]' => AcceptNegotiatorSupportedMediaTypesFactory::class, |
| 103 | + AcceptNegotiatorInterface::class.'supportedMediaTypes[]' => AcceptNegotiatorSupportedMediaTypesFactory::class, |
| 104 | + AcceptNegotiatorInterface::class => AcceptNegotiatorFactory::class, |
115 | 105 | ApiExceptionMiddleware::class => ApiExceptionMiddlewareFactory::class, |
116 | 106 | CacheItemPoolInterface::class => ApcuAdapterFactory::class, |
117 | 107 | Command::class.'[]' => CommandsFactory::class, |
118 | | - Connection::class => ConnectionFactory::class, |
119 | | - ConnectionProvider::class => ContainerConnectionProviderFactory::class, |
120 | 108 | ContentTypeMiddleware::class => ContentTypeMiddlewareFactory::class, |
121 | | - ContentTypeNegotiatorInterface::class => ContentTypeNegotiatorFactory::class, |
122 | 109 | ContentTypeNegotiatorInterface::class.'supportedMediaTypes[]' => ContentTypeNegotiatorSupportedMediaTypesFactory::class, |
| 110 | + ContentTypeNegotiatorInterface::class => ContentTypeNegotiatorFactory::class, |
123 | 111 | CorsMiddleware::class => CorsMiddlewareFactory::class, |
124 | 112 | DecoderInterface::class => DecoderFactory::class, |
| 113 | + DocumentManager::class => DocumentManagerFactory::class, |
125 | 114 | EncoderInterface::class => EncoderFactory::class, |
126 | | - EntityManagerInterface::class => EntityManagerFactory::class, |
127 | | - EntityManagerProvider::class => ContainerEntityManagerProviderFactory::class, |
128 | 115 | ExceptionMiddleware::class => ExceptionMiddlewareFactory::class, |
129 | 116 | LoggerInterface::class => LoggerFactory::class, |
130 | 117 | MappingDriver::class => ClassMapDriverFactory::class, |
|
140 | 127 | PetRepository::class => PetRepositoryFactory::class, |
141 | 128 | PingRequestHandler::class => PingRequestHandlerFactory::class, |
142 | 129 | ResponseFactoryInterface::class => ResponseFactoryFactory::class, |
143 | | - RouteInterface::class.'[]' => RoutesFactory::class, |
144 | 130 | RouteMatcherInterface::class => RouteMatcherFactory::class, |
145 | 131 | RouteMatcherMiddleware::class => RouteMatcherMiddlewareFactory::class, |
146 | 132 | RoutesByNameInterface::class => RoutesByNameFactory::class, |
| 133 | + RouteInterface::class.'[]' => RoutesFactory::class, |
147 | 134 | StreamFactoryInterface::class => StreamFactoryFactory::class, |
148 | 135 | TypeDecoderInterface::class.'[]' => TypeDecodersFactory::class, |
149 | 136 | TypeEncoderInterface::class.'[]' => TypeEncodersFactory::class, |
|
166 | 153 | 'namespace' => 'doctrine', |
167 | 154 | ], |
168 | 155 | ], |
169 | | - 'dbal' => [ |
170 | | - 'connection' => (new DsnParser(['pgsql' => 'pdo_pgsql']))->parse(getenv('POSTGRES_URI')), |
171 | | - ], |
172 | 156 | 'driver' => [ |
173 | 157 | 'classMap' => [ |
174 | 158 | 'map' => [ |
|
177 | 161 | ], |
178 | 162 | ], |
179 | 163 | ], |
180 | | - 'orm' => [ |
| 164 | + 'mongodb' => [ |
| 165 | + 'client' => [ |
| 166 | + 'uri' => getenv('MONGO_URI'), |
| 167 | + 'driverOptions' => [ |
| 168 | + 'typeMap' => DocumentManager::CLIENT_TYPEMAP, |
| 169 | + 'driver' => [ |
| 170 | + 'name' => 'doctrine-odm', |
| 171 | + ], |
| 172 | + ], |
| 173 | + ], |
| 174 | + ], |
| 175 | + 'mongodbOdm' => [ |
181 | 176 | 'configuration' => [ |
182 | 177 | 'metadataDriverImpl' => MappingDriver::class, |
183 | | - 'proxyDir' => $cacheDir.'/doctrine/orm/proxies', |
184 | | - 'proxyNamespace' => 'DoctrineORMProxy', |
| 178 | + 'proxyDir' => $cacheDir.'/doctrine/mongodbOdm/proxies', |
| 179 | + 'proxyNamespace' => 'DoctrineMongoDBODMProxy', |
| 180 | + 'hydratorDir' => $cacheDir.'/doctrine/mongodbOdm/hydrators', |
| 181 | + 'hydratorNamespace' => 'DoctrineMongoDBODMHydrators', |
185 | 182 | 'metadataCache' => CacheItemPoolInterface::class, |
| 183 | + 'defaultDB' => 'petstore', |
186 | 184 | ], |
187 | 185 | ], |
188 | 186 | ], |
|
0 commit comments