@@ -59,7 +59,6 @@ |
||
| 59 | 59 | * |
| 60 | 60 | * @ORM\Column(name="cod_ibge", type="integer", nullable=true) |
| 61 | 61 | * @Groups({"city_read","logistic_read","order_read", "people_read", "address_read", "delivery_region_read"}) |
| 62 | - |
|
| 63 | 62 | */ |
| 64 | 63 | private $cod_ibge; |
| 65 | 64 | /** |
@@ -43,7 +43,6 @@ |
||
| 43 | 43 | * |
| 44 | 44 | * @ORM\Column(name="cod_ibge", type="integer", nullable=true) |
| 45 | 45 | * @Groups({"city_read","logistic_read","state_read", "order_read", "people_read", "address_read", "delivery_region_read"}) |
| 46 | - |
|
| 47 | 46 | */ |
| 48 | 47 | private $cod_ibge; |
| 49 | 48 | /** |
@@ -26,7 +26,6 @@ discard block |
||
| 26 | 26 | * @ORM\Id |
| 27 | 27 | * @ORM\GeneratedValue(strategy="IDENTITY") |
| 28 | 28 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 29 | - |
|
| 30 | 29 | */ |
| 31 | 30 | private $id; |
| 32 | 31 | /** |
@@ -34,7 +33,6 @@ discard block |
||
| 34 | 33 | * |
| 35 | 34 | * @ORM\Column(name="countryCode", type="string", length=3, nullable=false) |
| 36 | 35 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 37 | - |
|
| 38 | 36 | */ |
| 39 | 37 | private $countrycode; |
| 40 | 38 | /** |
@@ -49,7 +47,6 @@ discard block |
||
| 49 | 47 | * |
| 50 | 48 | * @ORM\Column(name="currencyCode", type="string", length=3, nullable=true) |
| 51 | 49 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 52 | - |
|
| 53 | 50 | */ |
| 54 | 51 | private $currencycode; |
| 55 | 52 | /** |
@@ -57,7 +54,6 @@ discard block |
||
| 57 | 54 | * |
| 58 | 55 | * @ORM\Column(name="population", type="integer", nullable=true) |
| 59 | 56 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 60 | - |
|
| 61 | 57 | */ |
| 62 | 58 | private $population; |
| 63 | 59 | /** |
@@ -65,7 +61,6 @@ discard block |
||
| 65 | 61 | * |
| 66 | 62 | * @ORM\Column(name="fipsCode", type="string", length=2, nullable=true) |
| 67 | 63 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 68 | - |
|
| 69 | 64 | */ |
| 70 | 65 | private $fipscode; |
| 71 | 66 | /** |
@@ -81,7 +76,6 @@ discard block |
||
| 81 | 76 | * |
| 82 | 77 | * @ORM\Column(name="north", type="string", length=30, nullable=true) |
| 83 | 78 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 84 | - |
|
| 85 | 79 | */ |
| 86 | 80 | private $north; |
| 87 | 81 | /** |
@@ -89,7 +83,6 @@ discard block |
||
| 89 | 83 | * |
| 90 | 84 | * @ORM\Column(name="south", type="string", length=30, nullable=true) |
| 91 | 85 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 92 | - |
|
| 93 | 86 | */ |
| 94 | 87 | private $south; |
| 95 | 88 | /** |
@@ -98,7 +91,6 @@ discard block |
||
| 98 | 91 | * @ORM\Column(name="east", type="string", length=30, nullable=true) |
| 99 | 92 | * |
| 100 | 93 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 101 | - |
|
| 102 | 94 | */ |
| 103 | 95 | private $east; |
| 104 | 96 | /** |
@@ -106,7 +98,6 @@ discard block |
||
| 106 | 98 | * |
| 107 | 99 | * @ORM\Column(name="west", type="string", length=30, nullable=true) |
| 108 | 100 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 109 | - |
|
| 110 | 101 | */ |
| 111 | 102 | private $west; |
| 112 | 103 | /** |
@@ -114,7 +105,6 @@ discard block |
||
| 114 | 105 | * |
| 115 | 106 | * @ORM\Column(name="capital", type="string", length=30, nullable=true) |
| 116 | 107 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 117 | - |
|
| 118 | 108 | */ |
| 119 | 109 | private $capital; |
| 120 | 110 | /** |
@@ -122,7 +112,6 @@ discard block |
||
| 122 | 112 | * |
| 123 | 113 | * @ORM\Column(name="continentName", type="string", length=15, nullable=true) |
| 124 | 114 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 125 | - |
|
| 126 | 115 | */ |
| 127 | 116 | private $continentname; |
| 128 | 117 | /** |
@@ -130,7 +119,6 @@ discard block |
||
| 130 | 119 | * |
| 131 | 120 | * @ORM\Column(name="continent", type="string", length=2, nullable=true) |
| 132 | 121 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 133 | - |
|
| 134 | 122 | */ |
| 135 | 123 | private $continent; |
| 136 | 124 | /** |
@@ -138,7 +126,6 @@ discard block |
||
| 138 | 126 | * |
| 139 | 127 | * @ORM\Column(name="areaInSqKm", type="string", length=20, nullable=true) |
| 140 | 128 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 141 | - |
|
| 142 | 129 | */ |
| 143 | 130 | private $areainsqkm; |
| 144 | 131 | /** |
@@ -146,7 +133,6 @@ discard block |
||
| 146 | 133 | * |
| 147 | 134 | * @ORM\Column(name="isoAlpha3", type="string", length=3, nullable=true) |
| 148 | 135 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 149 | - |
|
| 150 | 136 | */ |
| 151 | 137 | private $isoalpha3; |
| 152 | 138 | /** |
@@ -154,7 +140,6 @@ discard block |
||
| 154 | 140 | * |
| 155 | 141 | * @ORM\Column(name="geonameId", type="integer", nullable=true) |
| 156 | 142 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 157 | - |
|
| 158 | 143 | */ |
| 159 | 144 | private $geonameid; |
| 160 | 145 | /** |
@@ -162,7 +147,6 @@ discard block |
||
| 162 | 147 | * |
| 163 | 148 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\LanguageCountry", mappedBy="country") |
| 164 | 149 | * @Groups({"city_read","logistic_read","state_read", "people_read", "address_read"}) |
| 165 | - |
|
| 166 | 150 | */ |
| 167 | 151 | private $languageCountry; |
| 168 | 152 | /** |
@@ -66,7 +66,6 @@ |
||
| 66 | 66 | * |
| 67 | 67 | * @ORM\Column(name="background", type="integer", nullable=true) |
| 68 | 68 | * @Groups({"theme_read"}) |
| 69 | - |
|
| 70 | 69 | */ |
| 71 | 70 | private $background; |
| 72 | 71 | /** |
@@ -22,65 +22,65 @@ |
||
| 22 | 22 | |
| 23 | 23 | public function findOneByCityStateCountryOfPeople(string $city, string $state, string $country, People $people): ?Address |
| 24 | 24 | { |
| 25 | - $result = $this->createQueryBuilder('a') |
|
| 26 | - ->innerJoin ('a.street' , 's') |
|
| 27 | - ->innerJoin ('s.district', 'd') |
|
| 28 | - ->innerJoin ('d.city' , 'c') |
|
| 29 | - ->innerJoin ('c.state' , 'e') |
|
| 30 | - ->innerJoin ('e.country' , 'u') |
|
| 25 | + $result = $this->createQueryBuilder('a') |
|
| 26 | + ->innerJoin ('a.street' , 's') |
|
| 27 | + ->innerJoin ('s.district', 'd') |
|
| 28 | + ->innerJoin ('d.city' , 'c') |
|
| 29 | + ->innerJoin ('c.state' , 'e') |
|
| 30 | + ->innerJoin ('e.country' , 'u') |
|
| 31 | 31 | |
| 32 | - ->andWhere ('c.city = :city' ) |
|
| 33 | - ->andWhere ('e.uf = :state' ) |
|
| 34 | - ->andWhere ('u.countryname = :country') |
|
| 35 | - ->andWhere ('a.people = :people' ) |
|
| 32 | + ->andWhere ('c.city = :city' ) |
|
| 33 | + ->andWhere ('e.uf = :state' ) |
|
| 34 | + ->andWhere ('u.countryname = :country') |
|
| 35 | + ->andWhere ('a.people = :people' ) |
|
| 36 | 36 | |
| 37 | - ->setParameter ('city' , $city ) |
|
| 38 | - ->setParameter ('state' , $state ) |
|
| 39 | - ->setParameter ('country', $country) |
|
| 40 | - ->setParameter ('people' , $people) |
|
| 37 | + ->setParameter ('city' , $city ) |
|
| 38 | + ->setParameter ('state' , $state ) |
|
| 39 | + ->setParameter ('country', $country) |
|
| 40 | + ->setParameter ('people' , $people) |
|
| 41 | 41 | |
| 42 | - ->getQuery() |
|
| 43 | - ->getResult() |
|
| 44 | - ; |
|
| 42 | + ->getQuery() |
|
| 43 | + ->getResult() |
|
| 44 | + ; |
|
| 45 | 45 | |
| 46 | - if (empty($result)) |
|
| 46 | + if (empty($result)) |
|
| 47 | 47 | return null; |
| 48 | 48 | |
| 49 | - return $result[0]; |
|
| 49 | + return $result[0]; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function findPeopleAddressBy(People $people, array $criteria): ?Address |
| 53 | 53 | { |
| 54 | - $result = $this->createQueryBuilder('a') |
|
| 55 | - ->innerJoin ('a.street' , 's') |
|
| 56 | - ->innerJoin ('s.district', 'd') |
|
| 57 | - ->innerJoin ('d.city' , 'c') |
|
| 58 | - ->innerJoin ('c.state' , 'e') |
|
| 59 | - ->innerJoin ('e.country' , 'u') |
|
| 54 | + $result = $this->createQueryBuilder('a') |
|
| 55 | + ->innerJoin ('a.street' , 's') |
|
| 56 | + ->innerJoin ('s.district', 'd') |
|
| 57 | + ->innerJoin ('d.city' , 'c') |
|
| 58 | + ->innerJoin ('c.state' , 'e') |
|
| 59 | + ->innerJoin ('e.country' , 'u') |
|
| 60 | 60 | |
| 61 | - ->andWhere ('a.people = :people' ) |
|
| 62 | - ->andWhere ('u.countryname = :country' ) |
|
| 63 | - ->andWhere ('(e.uf = :state OR e.state = :state)') |
|
| 64 | - ->andWhere ('c.city = :city' ) |
|
| 65 | - ->andWhere ('d.district = :district') |
|
| 66 | - ->andWhere ('s.street = :street' ) |
|
| 67 | - ->andWhere ('a.number = :number' ) |
|
| 61 | + ->andWhere ('a.people = :people' ) |
|
| 62 | + ->andWhere ('u.countryname = :country' ) |
|
| 63 | + ->andWhere ('(e.uf = :state OR e.state = :state)') |
|
| 64 | + ->andWhere ('c.city = :city' ) |
|
| 65 | + ->andWhere ('d.district = :district') |
|
| 66 | + ->andWhere ('s.street = :street' ) |
|
| 67 | + ->andWhere ('a.number = :number' ) |
|
| 68 | 68 | |
| 69 | - ->setParameter ('people' , $people) |
|
| 70 | - ->setParameter ('country' , $criteria['country'] ) |
|
| 71 | - ->setParameter ('state' , $criteria['state'] ) |
|
| 72 | - ->setParameter ('city' , $criteria['city'] ) |
|
| 73 | - ->setParameter ('district', $criteria['district']) |
|
| 74 | - ->setParameter ('street' , $criteria['street'] ) |
|
| 75 | - ->setParameter ('number' , $criteria['number'] ) |
|
| 69 | + ->setParameter ('people' , $people) |
|
| 70 | + ->setParameter ('country' , $criteria['country'] ) |
|
| 71 | + ->setParameter ('state' , $criteria['state'] ) |
|
| 72 | + ->setParameter ('city' , $criteria['city'] ) |
|
| 73 | + ->setParameter ('district', $criteria['district']) |
|
| 74 | + ->setParameter ('street' , $criteria['street'] ) |
|
| 75 | + ->setParameter ('number' , $criteria['number'] ) |
|
| 76 | 76 | |
| 77 | - ->getQuery() |
|
| 78 | - ->getResult() |
|
| 79 | - ; |
|
| 77 | + ->getQuery() |
|
| 78 | + ->getResult() |
|
| 79 | + ; |
|
| 80 | 80 | |
| 81 | - if (empty($result)) |
|
| 81 | + if (empty($result)) |
|
| 82 | 82 | return null; |
| 83 | 83 | |
| 84 | - return $result[0]; |
|
| 84 | + return $result[0]; |
|
| 85 | 85 | } |
| 86 | 86 | } |
@@ -14,91 +14,91 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | class GetActionByPeopleAction |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * Entity Manager |
|
| 19 | - * |
|
| 20 | - * @var EntityManagerInterface |
|
| 21 | - */ |
|
| 22 | - private $manager = null; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * Request |
|
| 26 | - * |
|
| 27 | - * @var Request |
|
| 28 | - */ |
|
| 29 | - private $request = null; |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * Security |
|
| 33 | - * |
|
| 34 | - * @var Security |
|
| 35 | - */ |
|
| 36 | - private $security = null; |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * @var \ControleOnline\Repository\MenuRepository |
|
| 40 | - */ |
|
| 41 | - private $repository = null; |
|
| 42 | - |
|
| 43 | - |
|
| 44 | - public function __construct(Security $security, EntityManagerInterface $entityManager) |
|
| 45 | - { |
|
| 17 | + /** |
|
| 18 | + * Entity Manager |
|
| 19 | + * |
|
| 20 | + * @var EntityManagerInterface |
|
| 21 | + */ |
|
| 22 | + private $manager = null; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * Request |
|
| 26 | + * |
|
| 27 | + * @var Request |
|
| 28 | + */ |
|
| 29 | + private $request = null; |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * Security |
|
| 33 | + * |
|
| 34 | + * @var Security |
|
| 35 | + */ |
|
| 36 | + private $security = null; |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * @var \ControleOnline\Repository\MenuRepository |
|
| 40 | + */ |
|
| 41 | + private $repository = null; |
|
| 42 | + |
|
| 43 | + |
|
| 44 | + public function __construct(Security $security, EntityManagerInterface $entityManager) |
|
| 45 | + { |
|
| 46 | 46 | $this->manager = $entityManager; |
| 47 | 47 | $this->security = $security; |
| 48 | - } |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - public function __invoke(Request $request): JsonResponse |
|
| 51 | - { |
|
| 50 | + public function __invoke(Request $request): JsonResponse |
|
| 51 | + { |
|
| 52 | 52 | try { |
| 53 | 53 | |
| 54 | - $menu = []; |
|
| 54 | + $menu = []; |
|
| 55 | 55 | |
| 56 | - $company = $request->query->get('myCompany', null); |
|
| 56 | + $company = $request->query->get('myCompany', null); |
|
| 57 | 57 | |
| 58 | - if ($company === null) |
|
| 58 | + if ($company === null) |
|
| 59 | 59 | throw new Exception("Company not found", 404); |
| 60 | 60 | |
| 61 | 61 | |
| 62 | - $myCompany = $this->manager->getRepository(People::class) |
|
| 62 | + $myCompany = $this->manager->getRepository(People::class) |
|
| 63 | 63 | ->find($company); |
| 64 | 64 | |
| 65 | - if ($myCompany === null) |
|
| 65 | + if ($myCompany === null) |
|
| 66 | 66 | throw new Exception("Company not found", 404); |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | |
| 70 | - $currentUser = $this->security->getUser(); |
|
| 71 | - /** |
|
| 72 | - * @var People |
|
| 73 | - */ |
|
| 74 | - $userPeople = $currentUser->getPeople(); |
|
| 70 | + $currentUser = $this->security->getUser(); |
|
| 71 | + /** |
|
| 72 | + * @var People |
|
| 73 | + */ |
|
| 74 | + $userPeople = $currentUser->getPeople(); |
|
| 75 | 75 | |
| 76 | - $menu = $this->getMenuByPeople($userPeople, $myCompany); |
|
| 76 | + $menu = $this->getMenuByPeople($userPeople, $myCompany); |
|
| 77 | 77 | |
| 78 | 78 | |
| 79 | - return new JsonResponse([ |
|
| 79 | + return new JsonResponse([ |
|
| 80 | 80 | 'response' => [ |
| 81 | - 'data' => $menu, |
|
| 82 | - 'count' => 1, |
|
| 83 | - 'error' => '', |
|
| 84 | - 'success' => true, |
|
| 81 | + 'data' => $menu, |
|
| 82 | + 'count' => 1, |
|
| 83 | + 'error' => '', |
|
| 84 | + 'success' => true, |
|
| 85 | 85 | ], |
| 86 | - ]); |
|
| 86 | + ]); |
|
| 87 | 87 | } catch (\Exception $e) { |
| 88 | 88 | |
| 89 | - return new JsonResponse([ |
|
| 89 | + return new JsonResponse([ |
|
| 90 | 90 | 'response' => [ |
| 91 | - 'data' => [], |
|
| 92 | - 'count' => 0, |
|
| 93 | - 'error' => $e->getMessage(), |
|
| 94 | - 'success' => false, |
|
| 91 | + 'data' => [], |
|
| 92 | + 'count' => 0, |
|
| 93 | + 'error' => $e->getMessage(), |
|
| 94 | + 'success' => false, |
|
| 95 | 95 | ], |
| 96 | - ]); |
|
| 96 | + ]); |
|
| 97 | + } |
|
| 97 | 98 | } |
| 98 | - } |
|
| 99 | 99 | |
| 100 | - private function getMenuByPeople(People $userPeople, People $myCompany) |
|
| 101 | - { |
|
| 100 | + private function getMenuByPeople(People $userPeople, People $myCompany) |
|
| 101 | + { |
|
| 102 | 102 | |
| 103 | 103 | $return = []; |
| 104 | 104 | $connection = $this->manager->getConnection(); |
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | $result = $statement->fetchAll(); |
| 134 | 134 | |
| 135 | 135 | foreach ($result as $action) { |
| 136 | - $return['routes'][trim($action['route'])]['actions'][$action['id']] = trim($action['action']); |
|
| 136 | + $return['routes'][trim($action['route'])]['actions'][$action['id']] = trim($action['action']); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | return $return; |
| 140 | - } |
|
| 140 | + } |
|
| 141 | 141 | } |
@@ -15,57 +15,57 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | class ConfigRepository extends ServiceEntityRepository |
| 17 | 17 | { |
| 18 | - public function __construct(ManagerRegistry $registry) |
|
| 19 | - { |
|
| 18 | + public function __construct(ManagerRegistry $registry) |
|
| 19 | + { |
|
| 20 | 20 | parent::__construct($registry, Config::class); |
| 21 | - } |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - public function updatePeopleConfigKey(People $people, string $key, string $value): void |
|
| 24 | - { |
|
| 23 | + public function updatePeopleConfigKey(People $people, string $key, string $value): void |
|
| 24 | + { |
|
| 25 | 25 | try { |
| 26 | - $params = []; |
|
| 26 | + $params = []; |
|
| 27 | 27 | |
| 28 | - $this->getEntityManager()->getConnection() |
|
| 28 | + $this->getEntityManager()->getConnection() |
|
| 29 | 29 | ->executeQuery('START TRANSACTION', $params); |
| 30 | 30 | |
| 31 | - $rawSQL = <<<SQL |
|
| 31 | + $rawSQL = <<<SQL |
|
| 32 | 32 | UPDATE config |
| 33 | 33 | SET config_value = :value |
| 34 | 34 | WHERE people_id = :id AND config_key = :key |
| 35 | 35 | SQL; |
| 36 | 36 | |
| 37 | - $params = [ |
|
| 37 | + $params = [ |
|
| 38 | 38 | 'id' => $people->getId(), |
| 39 | 39 | 'key' => $key, |
| 40 | 40 | 'value' => $value, |
| 41 | - ]; |
|
| 41 | + ]; |
|
| 42 | 42 | |
| 43 | - $this->getEntityManager()->getConnection() |
|
| 43 | + $this->getEntityManager()->getConnection() |
|
| 44 | 44 | ->executeQuery($rawSQL, $params); |
| 45 | 45 | |
| 46 | - $this->getEntityManager()->getConnection() |
|
| 46 | + $this->getEntityManager()->getConnection() |
|
| 47 | 47 | ->executeQuery('COMMIT', $params); |
| 48 | 48 | } catch (\Exception $e) { |
| 49 | - $this->getEntityManager()->getConnection() |
|
| 49 | + $this->getEntityManager()->getConnection() |
|
| 50 | 50 | ->executeQuery('ROLLBACK', $params); |
| 51 | 51 | |
| 52 | - throw new \Exception($e->getMessage()); |
|
| 52 | + throw new \Exception($e->getMessage()); |
|
| 53 | + } |
|
| 53 | 54 | } |
| 54 | - } |
|
| 55 | 55 | |
| 56 | - public function getKeyValuesByPeople(People $people, string $key): ?array |
|
| 57 | - { |
|
| 56 | + public function getKeyValuesByPeople(People $people, string $key): ?array |
|
| 57 | + { |
|
| 58 | 58 | $result = $this->createQueryBuilder('a') |
| 59 | - ->andWhere('a.people = :people') |
|
| 60 | - ->andWhere('a.config_key LIKE :prefix') |
|
| 61 | - ->setParameter('people', $people) |
|
| 62 | - ->setParameter('prefix', $key . '-%') |
|
| 59 | + ->andWhere('a.people = :people') |
|
| 60 | + ->andWhere('a.config_key LIKE :prefix') |
|
| 61 | + ->setParameter('people', $people) |
|
| 62 | + ->setParameter('prefix', $key . '-%') |
|
| 63 | 63 | |
| 64 | - ->getQuery() |
|
| 65 | - ->getResult(); |
|
| 64 | + ->getQuery() |
|
| 65 | + ->getResult(); |
|
| 66 | 66 | |
| 67 | 67 | if (empty($result)) |
| 68 | - return null; |
|
| 68 | + return null; |
|
| 69 | 69 | |
| 70 | 70 | $configs = []; |
| 71 | 71 | |
@@ -73,34 +73,34 @@ discard block |
||
| 73 | 73 | * @var Config $config |
| 74 | 74 | */ |
| 75 | 75 | foreach ($result as $config) { |
| 76 | - $configs[$config->getConfigKey()] = $config->getConfigValue(); |
|
| 76 | + $configs[$config->getConfigKey()] = $config->getConfigValue(); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | return $configs; |
| 80 | - } |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - public function getItauConfigByPeople(People $people): ?array |
|
| 83 | - { |
|
| 82 | + public function getItauConfigByPeople(People $people): ?array |
|
| 83 | + { |
|
| 84 | 84 | |
| 85 | 85 | $config = $this->getEntityManager()->getRepository(Config::class)->findOneBy([ |
| 86 | - 'people' => $people, |
|
| 87 | - 'config_key' => 'payment_type' |
|
| 86 | + 'people' => $people, |
|
| 87 | + 'config_key' => 'payment_type' |
|
| 88 | 88 | ]); |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | if (empty($config) || $config->getConfigValue() != 'itau') |
| 92 | - return null; |
|
| 92 | + return null; |
|
| 93 | 93 | |
| 94 | 94 | $result = $this->createQueryBuilder('a') |
| 95 | - ->andWhere('a.people = :people') |
|
| 96 | - ->andWhere('a.config_key LIKE :prefix') |
|
| 97 | - ->setParameter('people', $people) |
|
| 98 | - ->setParameter('prefix', 'itau-shopline-%') |
|
| 99 | - ->getQuery() |
|
| 100 | - ->getResult(); |
|
| 95 | + ->andWhere('a.people = :people') |
|
| 96 | + ->andWhere('a.config_key LIKE :prefix') |
|
| 97 | + ->setParameter('people', $people) |
|
| 98 | + ->setParameter('prefix', 'itau-shopline-%') |
|
| 99 | + ->getQuery() |
|
| 100 | + ->getResult(); |
|
| 101 | 101 | |
| 102 | 102 | if (empty($result)) |
| 103 | - return null; |
|
| 103 | + return null; |
|
| 104 | 104 | |
| 105 | 105 | $configs = []; |
| 106 | 106 | |
@@ -108,25 +108,25 @@ discard block |
||
| 108 | 108 | * @var Config $config |
| 109 | 109 | */ |
| 110 | 110 | foreach ($result as $config) { |
| 111 | - $configs[$config->getConfigKey()] = $config->getConfigValue(); |
|
| 111 | + $configs[$config->getConfigKey()] = $config->getConfigValue(); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | return $configs; |
| 115 | - } |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - public function getMauticConfigByPeople(People $people): ?array |
|
| 118 | - { |
|
| 117 | + public function getMauticConfigByPeople(People $people): ?array |
|
| 118 | + { |
|
| 119 | 119 | $result = $this->createQueryBuilder('a') |
| 120 | - ->andWhere('a.people = :people') |
|
| 121 | - ->andWhere('a.config_key LIKE :prefix') |
|
| 122 | - ->setParameter('people', $people) |
|
| 123 | - ->setParameter('prefix', 'mautic-%') |
|
| 120 | + ->andWhere('a.people = :people') |
|
| 121 | + ->andWhere('a.config_key LIKE :prefix') |
|
| 122 | + ->setParameter('people', $people) |
|
| 123 | + ->setParameter('prefix', 'mautic-%') |
|
| 124 | 124 | |
| 125 | - ->getQuery() |
|
| 126 | - ->getResult(); |
|
| 125 | + ->getQuery() |
|
| 126 | + ->getResult(); |
|
| 127 | 127 | |
| 128 | 128 | if (empty($result)) |
| 129 | - return null; |
|
| 129 | + return null; |
|
| 130 | 130 | |
| 131 | 131 | $configs = []; |
| 132 | 132 | |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | * @var Config $config |
| 135 | 135 | */ |
| 136 | 136 | foreach ($result as $config) { |
| 137 | - $configs[$config->getConfigKey()] = $config->getConfigValue(); |
|
| 137 | + $configs[$config->getConfigKey()] = $config->getConfigValue(); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | return $configs; |
| 141 | - } |
|
| 141 | + } |
|
| 142 | 142 | } |
@@ -10,16 +10,16 @@ |
||
| 10 | 10 | class NotificationService |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - public function __construct( |
|
| 13 | + public function __construct( |
|
| 14 | 14 | private EntityManagerInterface $manager, |
| 15 | 15 | private Security $security, |
| 16 | 16 | private RequestStack $requestStack, |
| 17 | 17 | private PusherService $pusher |
| 18 | - ) { |
|
| 19 | - } |
|
| 18 | + ) { |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - public function afterPersist(Notification $notification) |
|
| 22 | - { |
|
| 21 | + public function afterPersist(Notification $notification) |
|
| 22 | + { |
|
| 23 | 23 | $this->pusher->push(['company' => 1, 'people' => 1], 'my_topic'); |
| 24 | - } |
|
| 24 | + } |
|
| 25 | 25 | } |
@@ -76,7 +76,6 @@ |
||
| 76 | 76 | * |
| 77 | 77 | * @ORM\Column(name="visibility", type="string", length=255, nullable=false) |
| 78 | 78 | * @Groups({"config_read","config_write"}) |
| 79 | - |
|
| 80 | 79 | */ |
| 81 | 80 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['visibility' => 'exact'])] |
| 82 | 81 | |