@@ -35,7 +35,9 @@ discard block |
||
| 35 | 35 | $isSalesman = false; |
| 36 | 36 | |
| 37 | 37 | $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'salesman', 1); |
| 38 | - if ($isSalesman) return true; |
|
| 38 | + if ($isSalesman) { |
|
| 39 | + return true; |
|
| 40 | + } |
|
| 39 | 41 | |
| 40 | 42 | $getPeopleCompanies = $this->manager->getRepository(PeopleLink::class)->findBy([ |
| 41 | 43 | 'people' => $people, |
@@ -46,7 +48,9 @@ discard block |
||
| 46 | 48 | */ |
| 47 | 49 | foreach ($getPeopleCompanies as $peopleCompany) { |
| 48 | 50 | $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $peopleCompany->getCompany(), 'salesman', 1); |
| 49 | - if ($isSalesman) return true; |
|
| 51 | + if ($isSalesman) { |
|
| 52 | + return true; |
|
| 53 | + } |
|
| 50 | 54 | } |
| 51 | 55 | return $isSalesman; |
| 52 | 56 | } |
@@ -58,12 +62,14 @@ discard block |
||
| 58 | 62 | $mainCompany = $this->getMainCompany(); |
| 59 | 63 | |
| 60 | 64 | $isSuper = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'employee', 1); |
| 61 | - if ($isSuper) |
|
| 62 | - $peopleRole[] = 'super'; |
|
| 65 | + if ($isSuper) { |
|
| 66 | + $peopleRole[] = 'super'; |
|
| 67 | + } |
|
| 63 | 68 | |
| 64 | 69 | $family = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'family', 1); |
| 65 | - if ($family) |
|
| 66 | - $peopleRole[] = 'family'; |
|
| 70 | + if ($family) { |
|
| 71 | + $peopleRole[] = 'family'; |
|
| 72 | + } |
|
| 67 | 73 | |
| 68 | 74 | $isFranchisee = $this->isFranchisee($people); |
| 69 | 75 | if ($isFranchisee) { |
@@ -72,13 +78,15 @@ discard block |
||
| 72 | 78 | } |
| 73 | 79 | |
| 74 | 80 | $isClient = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'client', 1); |
| 75 | - if ($isClient) |
|
| 76 | - $peopleRole[] = 'client'; |
|
| 81 | + if ($isClient) { |
|
| 82 | + $peopleRole[] = 'client'; |
|
| 83 | + } |
|
| 77 | 84 | |
| 78 | 85 | |
| 79 | 86 | $isSalesman = $this->isSalesman($people); |
| 80 | - if ($isSalesman) |
|
| 81 | - $peopleRole[] = 'salesman'; |
|
| 87 | + if ($isSalesman) { |
|
| 88 | + $peopleRole[] = 'salesman'; |
|
| 89 | + } |
|
| 82 | 90 | |
| 83 | 91 | |
| 84 | 92 | return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole)); |
@@ -92,7 +100,9 @@ discard block |
||
| 92 | 100 | public function getMainCompany(): People |
| 93 | 101 | { |
| 94 | 102 | |
| 95 | - if (self::$mainCompany) return self::$mainCompany; |
|
| 103 | + if (self::$mainCompany) { |
|
| 104 | + return self::$mainCompany; |
|
| 105 | + } |
|
| 96 | 106 | |
| 97 | 107 | $peopleDomain = $this->domainService->getPeopleDomain(); |
| 98 | 108 | self::$mainCompany = $peopleDomain->getPeople(); |