| 1 | <?php |
||
| 7 | class SynchronizerManager |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | protected $synchronizers = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * {@inheritdoc} |
||
| 16 | */ |
||
| 17 | public function registerSynchronizer(SynchronizerInterface $synchronizer) |
||
| 18 | { |
||
| 19 | $this->synchronizers[$synchronizer->getClassName()][] = $synchronizer; |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param object $entity |
||
| 24 | * @return SynchronizerInterface[] |
||
| 25 | */ |
||
| 26 | protected function getSynchronizers($entity) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param object $entity |
||
| 39 | */ |
||
| 40 | public function synchronizeCreate($entity) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param object $entity |
||
| 49 | */ |
||
| 50 | public function synchronizeUpdate($entity) |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @param object $entity |
||
| 59 | */ |
||
| 60 | public function synchronizeDelete($entity) |
||
| 66 | } |
||
| 67 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: