Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function process( |
||
22 | mixed $data, |
||
23 | OperationInterface $operation, |
||
24 | array $uriVariables = [], |
||
25 | array $context = [] |
||
26 | ): void { |
||
27 | $manager = $this->registry->getManagerForClass($operation->getResource()->getDataClass()); |
||
|
|||
28 | |||
29 | if ($operation instanceof Create || $operation instanceof Update) { |
||
30 | $manager->persist($data); |
||
31 | $manager->flush(); |
||
32 | } |
||
33 | |||
34 | if ($operation instanceof Delete) { |
||
35 | $manager->remove($data); |
||
36 | $manager->flush(); |
||
37 | } |
||
40 |