@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | $payload = json_decode($request->getContent()); |
34 | 34 | if (isset($payload->link_type)) { |
35 | 35 | $company = $this->manager->getRepository(People::class)->find(preg_replace('/\D/', '', $payload->company)); |
36 | - if ($company) |
|
37 | - $this->addLink($company, $people, $payload->link_type); |
|
38 | - else { |
|
36 | + if ($company) { |
|
37 | + $this->addLink($company, $people, $payload->link_type); |
|
38 | + } else { |
|
39 | 39 | $link = $this->manager->getRepository(People::class)->find(preg_replace('/\D/', '', $payload->link)); |
40 | 40 | if ($payload->link_type == 'employee' && $link) { |
41 | 41 | $this->addLink($people, $link, $payload->link_type); |
@@ -63,8 +63,9 @@ discard block |
||
63 | 63 | 'link_type' => $link_type |
64 | 64 | ]); |
65 | 65 | |
66 | - if (!$peopleLink) |
|
67 | - $peopleLink = new PeopleLink(); |
|
66 | + if (!$peopleLink) { |
|
67 | + $peopleLink = new PeopleLink(); |
|
68 | + } |
|
68 | 69 | |
69 | 70 | $peopleLink->setCompany($company); |
70 | 71 | $peopleLink->setPeople($people); |