File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <[email protected] >
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Bridge \Doctrine \SchemaListener ;
13
+
14
+ use Doctrine \ORM \Tools \Event \GenerateSchemaEventArgs ;
15
+ use Symfony \Component \Lock \PersistingStoreInterface ;
16
+ use Symfony \Component \Lock \Store \DoctrineDbalStore ;
17
+
18
+ final class LockStoreSchemaSubscriber extends AbstractSchemaSubscriber
19
+ {
20
+ /**
21
+ * @param iterable<mixed, PersistingStoreInterface> $stores
22
+ */
23
+ public function __construct (private iterable $ stores )
24
+ {
25
+ }
26
+
27
+ public function postGenerateSchema (GenerateSchemaEventArgs $ event ): void
28
+ {
29
+ $ connection = $ event ->getEntityManager ()->getConnection ();
30
+
31
+ foreach ($ this ->stores as $ store ) {
32
+ if (!$ store instanceof DoctrineDbalStore) {
33
+ continue ;
34
+ }
35
+
36
+ $ store ->configureSchema ($ event ->getSchema (), $ this ->getIsSameDatabaseChecker ($ connection ));
37
+ }
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments