@@ -31,8 +31,9 @@ discard block |
||
31 | 31 | $payload = json_decode($request->getContent()); |
32 | 32 | if (isset($payload->link_type)) { |
33 | 33 | $company = $this->manager->getRepository(People::class)->find(preg_replace('/\D/', '', $payload->company)); |
34 | - if ($company) |
|
35 | - $this->addLink($company, $people, $payload->link_type); |
|
34 | + if ($company) { |
|
35 | + $this->addLink($company, $people, $payload->link_type); |
|
36 | + } |
|
36 | 37 | } |
37 | 38 | } |
38 | 39 | |
@@ -45,8 +46,9 @@ discard block |
||
45 | 46 | 'link_type' => $link_type |
46 | 47 | ]); |
47 | 48 | |
48 | - if (!$peopleLink) |
|
49 | - $peopleLink = new PeopleLink(); |
|
49 | + if (!$peopleLink) { |
|
50 | + $peopleLink = new PeopleLink(); |
|
51 | + } |
|
50 | 52 | |
51 | 53 | $peopleLink->setCompany($company); |
52 | 54 | $peopleLink->setPeople($people); |