Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
35 | public function save(EntityInterface $entity, DtoInterface $requestDto): NotificationInterface |
||
36 | { |
||
37 | $this->populateEntity($entity, $requestDto); |
||
38 | |||
39 | $validator = Validation::createValidator(); |
||
40 | $notification = $this->validate($entity, $validator); |
||
41 | |||
42 | if (false === $notification->hasErrorMessages()) { |
||
43 | $entityManager = $this->getEntityManager(); |
||
44 | $entityManager->persist($entity); |
||
45 | $entityManager->flush(); |
||
46 | } |
||
47 | |||
48 | return $notification; |
||
49 | } |
||
51 |