1 | <?php |
||
18 | abstract class DoctrineCommand extends Command |
||
19 | { |
||
20 | /** @var ManagerRegistry */ |
||
21 | protected $doctrine; |
||
22 | |||
23 | public function __construct(ManagerRegistry $doctrine) |
||
29 | |||
30 | /** |
||
31 | * get a doctrine entity generator |
||
32 | * |
||
33 | * @return EntityGenerator |
||
34 | */ |
||
35 | protected function getEntityGenerator() |
||
47 | |||
48 | /** |
||
49 | * Get a doctrine entity manager by symfony name. |
||
50 | * |
||
51 | * @param string $name |
||
52 | * @param int|null $shardId |
||
53 | * |
||
54 | * @return EntityManager |
||
55 | */ |
||
56 | protected function getEntityManager($name, $shardId = null) |
||
70 | |||
71 | /** |
||
72 | * Get a doctrine dbal connection by symfony name. |
||
73 | * |
||
74 | * @param string $name |
||
75 | * |
||
76 | * @return Connection |
||
77 | */ |
||
78 | protected function getDoctrineConnection($name) |
||
82 | } |
||
83 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: