@@ -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 | } |
@@ -9,24 +9,24 @@ |
||
9 | 9 | class WordPressService |
10 | 10 | { |
11 | 11 | |
12 | - public function __construct(private EntityManagerInterface $manager, private RequestStack $requestStack) {} |
|
12 | + public function __construct(private EntityManagerInterface $manager, private RequestStack $requestStack) {} |
|
13 | 13 | |
14 | - public static function getAllPosts($domain, array $input): array |
|
15 | - { |
|
14 | + public static function getAllPosts($domain, array $input): array |
|
15 | + { |
|
16 | 16 | |
17 | 17 | try { |
18 | - $client = new Client(['verify' => false]); |
|
19 | - $response = $client->get($domain . '/wp-json/wp/v2/posts', [ |
|
18 | + $client = new Client(['verify' => false]); |
|
19 | + $response = $client->get($domain . '/wp-json/wp/v2/posts', [ |
|
20 | 20 | 'query' => $input |
21 | - ]); |
|
21 | + ]); |
|
22 | 22 | |
23 | - $result = json_decode($response->getBody()); |
|
23 | + $result = json_decode($response->getBody()); |
|
24 | 24 | |
25 | - return $result; |
|
25 | + return $result; |
|
26 | 26 | } catch (\Exception $e) { |
27 | - print_r($e); |
|
27 | + print_r($e); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | return null; |
31 | - } |
|
31 | + } |
|
32 | 32 | } |
@@ -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 |
@@ -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 | /** |
@@ -19,13 +19,13 @@ |
||
19 | 19 | |
20 | 20 | public function getFileUrl(People $people): ?array |
21 | 21 | { |
22 | - if ($people->getImage() instanceof File) |
|
22 | + if ($people->getImage() instanceof File) |
|
23 | 23 | return [ |
24 | - 'id' => $people->getImage()->getId(), |
|
25 | - 'domain' => $this->domainService->getMainDomain(), |
|
26 | - 'url' => '/files/' . $people->getImage()->getId() . '/download' |
|
24 | + 'id' => $people->getImage()->getId(), |
|
25 | + 'domain' => $this->domainService->getMainDomain(), |
|
26 | + 'url' => '/files/' . $people->getImage()->getId() . '/download' |
|
27 | 27 | ]; |
28 | 28 | |
29 | - return null; |
|
29 | + return null; |
|
30 | 30 | } |
31 | 31 | } |
@@ -51,7 +51,6 @@ |
||
51 | 51 | * |
52 | 52 | * @ORM\Column(name="cod_ibge", type="integer", nullable=true) |
53 | 53 | * @Groups({"city:read","logistic:read","state:read", "order_details:read", "people:read", "address:read", "delivery_region:read"}) |
54 | - |
|
55 | 54 | */ |
56 | 55 | private $cod_ibge; |
57 | 56 | /** |
@@ -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_details:read","order:write", "people:read", "address:read", "delivery_region:read"}) |
62 | - |
|
63 | 62 | */ |
64 | 63 | private $cod_ibge; |
65 | 64 | /** |
@@ -33,7 +33,6 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @ORM\Column(name="countryCode", type="string", length=3, nullable=false) |
35 | 35 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
36 | - |
|
37 | 36 | */ |
38 | 37 | private $countrycode; |
39 | 38 | /** |
@@ -48,7 +47,6 @@ discard block |
||
48 | 47 | * |
49 | 48 | * @ORM\Column(name="currencyCode", type="string", length=3, nullable=true) |
50 | 49 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
51 | - |
|
52 | 50 | */ |
53 | 51 | private $currencycode; |
54 | 52 | /** |
@@ -56,7 +54,6 @@ discard block |
||
56 | 54 | * |
57 | 55 | * @ORM\Column(name="population", type="integer", nullable=true) |
58 | 56 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
59 | - |
|
60 | 57 | */ |
61 | 58 | private $population; |
62 | 59 | /** |
@@ -64,7 +61,6 @@ discard block |
||
64 | 61 | * |
65 | 62 | * @ORM\Column(name="fipsCode", type="string", length=2, nullable=true) |
66 | 63 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
67 | - |
|
68 | 64 | */ |
69 | 65 | private $fipscode; |
70 | 66 | /** |
@@ -80,7 +76,6 @@ discard block |
||
80 | 76 | * |
81 | 77 | * @ORM\Column(name="north", type="string", length=30, nullable=true) |
82 | 78 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
83 | - |
|
84 | 79 | */ |
85 | 80 | private $north; |
86 | 81 | /** |
@@ -88,7 +83,6 @@ discard block |
||
88 | 83 | * |
89 | 84 | * @ORM\Column(name="south", type="string", length=30, nullable=true) |
90 | 85 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
91 | - |
|
92 | 86 | */ |
93 | 87 | private $south; |
94 | 88 | /** |
@@ -97,7 +91,6 @@ discard block |
||
97 | 91 | * @ORM\Column(name="east", type="string", length=30, nullable=true) |
98 | 92 | * |
99 | 93 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
100 | - |
|
101 | 94 | */ |
102 | 95 | private $east; |
103 | 96 | /** |
@@ -105,7 +98,6 @@ discard block |
||
105 | 98 | * |
106 | 99 | * @ORM\Column(name="west", type="string", length=30, nullable=true) |
107 | 100 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
108 | - |
|
109 | 101 | */ |
110 | 102 | private $west; |
111 | 103 | /** |
@@ -113,7 +105,6 @@ discard block |
||
113 | 105 | * |
114 | 106 | * @ORM\Column(name="capital", type="string", length=30, nullable=true) |
115 | 107 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
116 | - |
|
117 | 108 | */ |
118 | 109 | private $capital; |
119 | 110 | /** |
@@ -121,7 +112,6 @@ discard block |
||
121 | 112 | * |
122 | 113 | * @ORM\Column(name="continentName", type="string", length=15, nullable=true) |
123 | 114 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
124 | - |
|
125 | 115 | */ |
126 | 116 | private $continentname; |
127 | 117 | /** |
@@ -129,7 +119,6 @@ discard block |
||
129 | 119 | * |
130 | 120 | * @ORM\Column(name="continent", type="string", length=2, nullable=true) |
131 | 121 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
132 | - |
|
133 | 122 | */ |
134 | 123 | private $continent; |
135 | 124 | /** |
@@ -137,7 +126,6 @@ discard block |
||
137 | 126 | * |
138 | 127 | * @ORM\Column(name="areaInSqKm", type="string", length=20, nullable=true) |
139 | 128 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
140 | - |
|
141 | 129 | */ |
142 | 130 | private $areainsqkm; |
143 | 131 | /** |
@@ -145,7 +133,6 @@ discard block |
||
145 | 133 | * |
146 | 134 | * @ORM\Column(name="isoAlpha3", type="string", length=3, nullable=true) |
147 | 135 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
148 | - |
|
149 | 136 | */ |
150 | 137 | private $isoalpha3; |
151 | 138 | /** |
@@ -153,7 +140,6 @@ discard block |
||
153 | 140 | * |
154 | 141 | * @ORM\Column(name="geonameId", type="integer", nullable=true) |
155 | 142 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
156 | - |
|
157 | 143 | */ |
158 | 144 | private $geonameid; |
159 | 145 | /** |
@@ -161,7 +147,6 @@ discard block |
||
161 | 147 | * |
162 | 148 | * @ORM\OneToMany(targetEntity="ControleOnline\Entity\LanguageCountry", mappedBy="country") |
163 | 149 | * @Groups({"city:read","logistic:read","state:read", "people:read","order_details:read","order:write", "address:read"}) |
164 | - |
|
165 | 150 | */ |
166 | 151 | private $languageCountry; |
167 | 152 | /** |
@@ -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 configValue = :value |
34 | 34 | WHERE people_id = :id AND configKey = :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.configKey LIKE :prefix') |
|
61 | - ->setParameter('people', $people) |
|
62 | - ->setParameter('prefix', $key . '-%') |
|
59 | + ->andWhere('a.people = :people') |
|
60 | + ->andWhere('a.configKey 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 | - 'configKey' => 'payment_type' |
|
86 | + 'people' => $people, |
|
87 | + 'configKey' => '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.configKey LIKE :prefix') |
|
97 | - ->setParameter('people', $people) |
|
98 | - ->setParameter('prefix', 'itau-shopline-%') |
|
99 | - ->getQuery() |
|
100 | - ->getResult(); |
|
95 | + ->andWhere('a.people = :people') |
|
96 | + ->andWhere('a.configKey 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.configKey LIKE :prefix') |
|
122 | - ->setParameter('people', $people) |
|
123 | - ->setParameter('prefix', 'mautic-%') |
|
120 | + ->andWhere('a.people = :people') |
|
121 | + ->andWhere('a.configKey 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 | } |