@@ -51,8 +51,9 @@ |
||
| 51 | 51 | $service = $this->container->get($serviceName); |
| 52 | 52 | if (method_exists($service, $method)) { |
| 53 | 53 | $entity = $service->$method($entity); |
| 54 | - if ('afterPersist' === $method && $entity) |
|
| 55 | - $this->manager->refresh($entity); |
|
| 54 | + if ('afterPersist' === $method && $entity) { |
|
| 55 | + $this->manager->refresh($entity); |
|
| 56 | + } |
|
| 56 | 57 | } |
| 57 | 58 | } |
| 58 | 59 | } |
@@ -24,11 +24,13 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | public function persist() |
| 26 | 26 | { |
| 27 | - if (self::$persisted == true) |
|
| 28 | - return; |
|
| 27 | + if (self::$persisted == true) { |
|
| 28 | + return; |
|
| 29 | + } |
|
| 29 | 30 | $extra_data = json_decode($this->request->getContent(), true)['extra-data'] ?? null; |
| 30 | - if (!$extra_data) |
|
| 31 | - return; |
|
| 31 | + if (!$extra_data) { |
|
| 32 | + return; |
|
| 33 | + } |
|
| 32 | 34 | foreach ($extra_data['data'] as $key => $data) { |
| 33 | 35 | $extra_fields = $this->manager->getRepository(ExtraFields::class)->find($key); |
| 34 | 36 | |
@@ -38,8 +40,9 @@ discard block |
||
| 38 | 40 | 'extra_fields' => $extra_fields |
| 39 | 41 | ]); |
| 40 | 42 | |
| 41 | - if (!$extraData) |
|
| 42 | - $extraData = new ExtraData(); |
|
| 43 | + if (!$extraData) { |
|
| 44 | + $extraData = new ExtraData(); |
|
| 45 | + } |
|
| 43 | 46 | |
| 44 | 47 | $extraData->setExtraFields($extra_fields); |
| 45 | 48 | $extraData->setEntityName($extra_data['entity_name']); |
@@ -38,8 +38,9 @@ |
||
| 38 | 38 | ) |
| 39 | 39 | )); |
| 40 | 40 | |
| 41 | - if (!$domain) |
|
| 42 | - throw new InvalidArgumentException('Please define header or get param "app-domain"', 301); |
|
| 41 | + if (!$domain) { |
|
| 42 | + throw new InvalidArgumentException('Please define header or get param "app-domain"', 301); |
|
| 43 | + } |
|
| 43 | 44 | return $domain; |
| 44 | 45 | } |
| 45 | 46 | |