1 | <?php |
||
18 | abstract class DoctrineCommand extends Command |
||
19 | { |
||
20 | protected $doctrine; |
||
21 | |||
22 | public function __construct(ManagerRegistry $doctrine) |
||
28 | |||
29 | /** |
||
30 | * get a doctrine entity generator |
||
31 | * |
||
32 | * @return EntityGenerator |
||
33 | */ |
||
34 | protected function getEntityGenerator() |
||
46 | |||
47 | /** |
||
48 | * Get a doctrine entity manager by symfony name. |
||
49 | * |
||
50 | * @param string $name |
||
51 | * @param int|null $shardId |
||
52 | * |
||
53 | * @return EntityManager |
||
54 | */ |
||
55 | protected function getEntityManager($name, $shardId = null) |
||
69 | |||
70 | /** |
||
71 | * Get a doctrine dbal connection by symfony name. |
||
72 | * |
||
73 | * @param string $name |
||
74 | * |
||
75 | * @return Connection |
||
76 | */ |
||
77 | protected function getDoctrineConnection($name) |
||
81 | } |
||
82 |
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: