@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $css = ':root{' . PHP_EOL; |
| 35 | 35 | foreach ($theme->getColors(true) as $index => $color) { |
| 36 | 36 | $css .= ' --q-' . $index . ': ' . $color . ';' . PHP_EOL; |
| 37 | - $css .= ' --' . $index . ': ' . $color . ';' . PHP_EOL; |
|
| 37 | + $css .= ' --' . $index . ': ' . $color . ';' . PHP_EOL; |
|
| 38 | 38 | } |
| 39 | 39 | $css .= '}'; |
| 40 | 40 | return new Response($css, Response::HTTP_OK, [ |
@@ -42,13 +42,13 @@ discard block |
||
| 42 | 42 | $this->uri = $this->request ? $this->request->getPathInfo() : ''; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function collection($class, $groups, mixed $arguments = [], int $limit = 0, int $page = 1, array $orderby = []) |
|
| 45 | + public function collection($class, $groups, mixed $arguments = [], int $limit = 0, int $page = 1, array $orderby = []) |
|
| 46 | 46 | { |
| 47 | 47 | $response = $this->getBasicResponse($class); |
| 48 | 48 | |
| 49 | - $response['hydra:member'] = $this->getMembers($class, $groups, $arguments, $limit, $page, $orderby); |
|
| 50 | - $response['hydra:search'] = $this->getSearch($class); |
|
| 51 | - $response['hydra:totalItems'] = $this->getCount($class, $arguments); |
|
| 49 | + $response['hydra:member'] = $this->getMembers($class, $groups, $arguments, $limit, $page, $orderby); |
|
| 50 | + $response['hydra:search'] = $this->getSearch($class); |
|
| 51 | + $response['hydra:totalItems'] = $this->getCount($class, $arguments); |
|
| 52 | 52 | |
| 53 | 53 | return $response; |
| 54 | 54 | } |
@@ -58,15 +58,15 @@ discard block |
||
| 58 | 58 | //$response = $this->getBasicResponse($class); |
| 59 | 59 | //$response['hydra:search'] = $this->getSearch($class); |
| 60 | 60 | |
| 61 | - $response['hydra:member'] = $result; |
|
| 62 | - $response['hydra:totalItems'] = count($response['hydra:member']); |
|
| 61 | + $response['hydra:member'] = $result; |
|
| 62 | + $response['hydra:totalItems'] = count($response['hydra:member']); |
|
| 63 | 63 | |
| 64 | 64 | return $response; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function item($class, $id, $groups) |
| 68 | 68 | { |
| 69 | - $data = $this->manager->getRepository($class)->find(preg_replace("/[^0-9]/", "", $id)); |
|
| 69 | + $data = $this->manager->getRepository($class)->find(preg_replace("/[^0-9]/", "", $id)); |
|
| 70 | 70 | $analisesSerialized = $this->serializer->serialize($data, 'jsonld', ['groups' => $groups]); |
| 71 | 71 | return json_decode($analisesSerialized); |
| 72 | 72 | } |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | $className = substr($class, strrpos($class, '\\') + 1); |
| 77 | 77 | |
| 78 | 78 | $response['@id'] = '/' . strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $className)) . 's'; |
| 79 | - $response['@context'] = "/contexts/" . $className; |
|
| 80 | - $response['@type'] = "hydra:Collection"; |
|
| 79 | + $response['@context'] = "/contexts/" . $className; |
|
| 80 | + $response['@type'] = "hydra:Collection"; |
|
| 81 | 81 | |
| 82 | 82 | $response['hydra:view'] = [ |
| 83 | 83 | '@id' => $this->uri, |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | if ($page == 1) |
| 96 | 96 | $offset = (($page = $this->request->get('page') ?: 1) - 1) * $limit; |
| 97 | 97 | |
| 98 | - $data = $this->manager->getRepository($class)->findBy($arguments, $orderby, $limit, $offset); |
|
| 98 | + $data = $this->manager->getRepository($class)->findBy($arguments, $orderby, $limit, $offset); |
|
| 99 | 99 | |
| 100 | 100 | return $this->serialize($data, ['groups' => $groups]); |
| 101 | 101 | } |
@@ -23,21 +23,21 @@ discard block |
||
| 23 | 23 | public function findOneByCityStateCountryOfPeople(string $city, string $state, string $country, People $people): ?Address |
| 24 | 24 | { |
| 25 | 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') |
|
| 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 | 42 | ->getQuery() |
| 43 | 43 | ->getResult() |
@@ -52,27 +52,27 @@ discard block |
||
| 52 | 52 | public function findPeopleAddressBy(People $people, array $criteria): ?Address |
| 53 | 53 | { |
| 54 | 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') |
|
| 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 | 77 | ->getQuery() |
| 78 | 78 | ->getResult() |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @var Request |
| 28 | 28 | */ |
| 29 | - private $request = null; |
|
| 29 | + private $request = null; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Security |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | try { |
| 54 | 54 | |
| 55 | - $menu = []; |
|
| 55 | + $menu = []; |
|
| 56 | 56 | |
| 57 | 57 | $company = $request->query->get('myCompany', null); |
| 58 | 58 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | $userPeople = $currentUser->getPeople(); |
| 76 | 76 | |
| 77 | - $menu = $this->getMenuByPeople($userPeople, $myCompany); |
|
| 77 | + $menu = $this->getMenuByPeople($userPeople, $myCompany); |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | return new JsonResponse([ |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | // build query |
| 108 | 108 | |
| 109 | - $sql = 'SELECT menu.*, |
|
| 109 | + $sql = 'SELECT menu.*, |
|
| 110 | 110 | category.name AS category_label, |
| 111 | 111 | category.color AS category_color, |
| 112 | 112 | routes.route AS route, |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | $params = []; |
| 124 | 124 | |
| 125 | - $params['myCompany'] = $myCompany->getId(); |
|
| 126 | - $params['userPeople'] = $userPeople->getId(); |
|
| 125 | + $params['myCompany'] = $myCompany->getId(); |
|
| 126 | + $params['userPeople'] = $userPeople->getId(); |
|
| 127 | 127 | // execute query |
| 128 | 128 | |
| 129 | 129 | $statement = $connection->prepare($sql); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @var Request |
| 28 | 28 | */ |
| 29 | - private $request = null; |
|
| 29 | + private $request = null; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Security |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | try { |
| 53 | 53 | |
| 54 | - $menu = []; |
|
| 54 | + $menu = []; |
|
| 55 | 55 | |
| 56 | 56 | $company = $request->query->get('myCompany', null); |
| 57 | 57 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | $userPeople = $currentUser->getPeople(); |
| 75 | 75 | |
| 76 | - $menu = $this->getMenuByPeople($userPeople, $myCompany); |
|
| 76 | + $menu = $this->getMenuByPeople($userPeople, $myCompany); |
|
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | return new JsonResponse([ |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | // build query |
| 107 | 107 | |
| 108 | - $sql = 'SELECT action.*,routes.route |
|
| 108 | + $sql = 'SELECT action.*,routes.route |
|
| 109 | 109 | |
| 110 | 110 | FROM action |
| 111 | 111 | INNER JOIN routes ON routes.id = action.route_id |
@@ -122,9 +122,9 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | $params = []; |
| 124 | 124 | |
| 125 | - $params['myCompany'] = $myCompany->getId(); |
|
| 126 | - $params['userPeople'] = $userPeople->getId(); |
|
| 127 | - $params['route'] = $this->route; |
|
| 125 | + $params['myCompany'] = $myCompany->getId(); |
|
| 126 | + $params['userPeople'] = $userPeople->getId(); |
|
| 127 | + $params['route'] = $this->route; |
|
| 128 | 128 | // execute query |
| 129 | 129 | |
| 130 | 130 | $statement = $connection->prepare($sql); |