1 | <?php |
||
19 | abstract class DoctrineCommand extends Command |
||
20 | { |
||
21 | /** @var ManagerRegistry|null */ |
||
22 | private $doctrine; |
||
23 | |||
24 | /** @var ContainerInterface|null */ |
||
25 | private $container; |
||
26 | |||
27 | public function __construct(ManagerRegistry $doctrine = null) |
||
41 | |||
42 | /** |
||
43 | * @deprecated |
||
44 | */ |
||
45 | public function setContainer(ContainerInterface $container = null) |
||
51 | |||
52 | /** |
||
53 | * @return ContainerInterface |
||
54 | * |
||
55 | * @throws \LogicException |
||
56 | * |
||
57 | * @deprecated |
||
58 | */ |
||
59 | protected function getContainer() |
||
74 | |||
75 | /** |
||
76 | * get a doctrine entity generator |
||
77 | * |
||
78 | * @return EntityGenerator |
||
79 | */ |
||
80 | protected function getEntityGenerator() |
||
92 | |||
93 | /** |
||
94 | * Get a doctrine entity manager by symfony name. |
||
95 | * |
||
96 | * @param string $name |
||
97 | * @param int|null $shardId |
||
98 | * |
||
99 | * @return EntityManager |
||
100 | */ |
||
101 | protected function getEntityManager($name, $shardId = null) |
||
115 | |||
116 | /** |
||
117 | * Get a doctrine dbal connection by symfony name. |
||
118 | * |
||
119 | * @param string $name |
||
120 | * |
||
121 | * @return Connection |
||
122 | */ |
||
123 | protected function getDoctrineConnection($name) |
||
127 | |||
128 | /** |
||
129 | * @return ManagerRegistry |
||
130 | */ |
||
131 | protected function getDoctrine() |
||
135 | } |
||
136 |
If you suppress an error, we recommend checking for the error condition explicitly: