@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | return; |
| 29 | 29 | self::$persisted = true; |
| 30 | 30 | |
| 31 | - $json = json_decode($this->request->getContent(), true); |
|
| 31 | + $json = json_decode($this->request->getContent(), true); |
|
| 32 | 32 | $extra_data = isset($json['extra-data']) ? $json['extra-data'] : null; |
| 33 | 33 | |
| 34 | 34 | if (!$extra_data) |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | if (!$entity_id || !$entity_name) |
| 47 | 47 | return; |
| 48 | - $json = json_decode($this->request->getContent(), true); |
|
| 48 | + $json = json_decode($this->request->getContent(), true); |
|
| 49 | 49 | $extra_data = isset($json['extra-data']) ? $json['extra-data'] : null; |
| 50 | 50 | |
| 51 | 51 | if (!$extra_data) |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | if (self::$persisted == true) |
| 81 | 81 | return; |
| 82 | 82 | self::$persisted = true; |
| 83 | - $json = json_decode($this->request->getContent(), true); |
|
| 83 | + $json = json_decode($this->request->getContent(), true); |
|
| 84 | 84 | $extra_data = isset($json['extra-data']) ? $json['extra-data'] : null; |
| 85 | 85 | if (!$extra_data) |
| 86 | 86 | return; |
@@ -24,15 +24,17 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | public function persist($entity) |
| 26 | 26 | { |
| 27 | - if (self::$persisted == true) |
|
| 28 | - return; |
|
| 27 | + if (self::$persisted == true) { |
|
| 28 | + return; |
|
| 29 | + } |
|
| 29 | 30 | self::$persisted = true; |
| 30 | 31 | |
| 31 | 32 | $json = json_decode($this->request->getContent(), true); |
| 32 | 33 | $extra_data = isset($json['extra-data']) ? $json['extra-data'] : null; |
| 33 | 34 | |
| 34 | - if (!$extra_data) |
|
| 35 | - return; |
|
| 35 | + if (!$extra_data) { |
|
| 36 | + return; |
|
| 37 | + } |
|
| 36 | 38 | |
| 37 | 39 | //$this->manager->persist($entity); |
| 38 | 40 | //$this->manager->flush(); |
@@ -43,13 +45,15 @@ discard block |
||
| 43 | 45 | } |
| 44 | 46 | private function persistData($entity_id, $entity_name) |
| 45 | 47 | { |
| 46 | - if (!$entity_id || !$entity_name) |
|
| 47 | - return; |
|
| 48 | + if (!$entity_id || !$entity_name) { |
|
| 49 | + return; |
|
| 50 | + } |
|
| 48 | 51 | $json = json_decode($this->request->getContent(), true); |
| 49 | 52 | $extra_data = isset($json['extra-data']) ? $json['extra-data'] : null; |
| 50 | 53 | |
| 51 | - if (!$extra_data) |
|
| 52 | - return; |
|
| 54 | + if (!$extra_data) { |
|
| 55 | + return; |
|
| 56 | + } |
|
| 53 | 57 | |
| 54 | 58 | |
| 55 | 59 | foreach ($extra_data['data'] as $key => $data) { |
@@ -61,8 +65,9 @@ discard block |
||
| 61 | 65 | 'extra_fields' => $extra_fields |
| 62 | 66 | ]); |
| 63 | 67 | |
| 64 | - if (!$extraData) |
|
| 65 | - $extraData = new ExtraData(); |
|
| 68 | + if (!$extraData) { |
|
| 69 | + $extraData = new ExtraData(); |
|
| 70 | + } |
|
| 66 | 71 | |
| 67 | 72 | $extraData->setExtraFields($extra_fields); |
| 68 | 73 | $extraData->setEntityName($entity_name); |
@@ -77,13 +82,15 @@ discard block |
||
| 77 | 82 | |
| 78 | 83 | public function noChange() |
| 79 | 84 | { |
| 80 | - if (self::$persisted == true) |
|
| 81 | - return; |
|
| 85 | + if (self::$persisted == true) { |
|
| 86 | + return; |
|
| 87 | + } |
|
| 82 | 88 | self::$persisted = true; |
| 83 | 89 | $json = json_decode($this->request->getContent(), true); |
| 84 | 90 | $extra_data = isset($json['extra-data']) ? $json['extra-data'] : null; |
| 85 | - if (!$extra_data) |
|
| 86 | - return; |
|
| 91 | + if (!$extra_data) { |
|
| 92 | + return; |
|
| 93 | + } |
|
| 87 | 94 | |
| 88 | 95 | $this->persistData($extra_data['entity_id'], $extra_data['entity_name']); |
| 89 | 96 | } |