@@ -32,23 +32,23 @@ discard block |
||
| 32 | 32 | return $e; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function collectionData($data, $class, $groups, mixed $arguments = []) |
|
| 35 | + public function collectionData($data, $class, $groups, mixed $arguments = []) |
|
| 36 | 36 | { |
| 37 | 37 | $response = $this->getBasicResponse($class); |
| 38 | 38 | |
| 39 | - $response['member'] = $this->data($data, $groups); |
|
| 40 | - $response['search'] = $this->getSearch($class); |
|
| 41 | - $response['totalItems'] = $this->getCount($class, $arguments); |
|
| 39 | + $response['member'] = $this->data($data, $groups); |
|
| 40 | + $response['search'] = $this->getSearch($class); |
|
| 41 | + $response['totalItems'] = $this->getCount($class, $arguments); |
|
| 42 | 42 | |
| 43 | 43 | return $response; |
| 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['member'] = $this->getMembers($class, $groups, $arguments, $limit, $page, $orderby); |
|
| 50 | - $response['search'] = $this->getSearch($class); |
|
| 51 | - $response['totalItems'] = $this->getCount($class, $arguments); |
|
| 49 | + $response['member'] = $this->getMembers($class, $groups, $arguments, $limit, $page, $orderby); |
|
| 50 | + $response['search'] = $this->getSearch($class); |
|
| 51 | + $response['totalItems'] = $this->getCount($class, $arguments); |
|
| 52 | 52 | |
| 53 | 53 | return $response; |
| 54 | 54 | } |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | //$response = $this->getBasicResponse($class); |
| 59 | 59 | //$response['search'] = $this->getSearch($class); |
| 60 | 60 | |
| 61 | - $response['member'] = $result; |
|
| 62 | - $response['totalItems'] = count($response['member']); |
|
| 61 | + $response['member'] = $result; |
|
| 62 | + $response['totalItems'] = count($response['member']); |
|
| 63 | 63 | |
| 64 | 64 | return $response; |
| 65 | 65 | } |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | $className = substr($class, strrpos($class, '\\') + 1); |
| 83 | 83 | |
| 84 | 84 | $response['@id'] = '/' . strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $className)) . 's'; |
| 85 | - $response['@context'] = "/contexts/" . $className; |
|
| 86 | - $response['@type'] = "Collection"; |
|
| 85 | + $response['@context'] = "/contexts/" . $className; |
|
| 86 | + $response['@type'] = "Collection"; |
|
| 87 | 87 | |
| 88 | 88 | $response['view'] = [ |
| 89 | 89 | '@id' => $this->uri, |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | if ($page == 1) |
| 102 | 102 | $offset = (($page = $this->request->get('page') ?: 1) - 1) * $limit; |
| 103 | 103 | |
| 104 | - $data = $this->manager->getRepository($class)->findBy($arguments, $orderby, $limit, $offset); |
|
| 104 | + $data = $this->manager->getRepository($class)->findBy($arguments, $orderby, $limit, $offset); |
|
| 105 | 105 | |
| 106 | 106 | return $this->serialize($data, ['groups' => $groups]); |
| 107 | 107 | } |