@@ 103-113 (lines=11) @@ | ||
100 | return new Paginator($queryBuilder->getQuery()->execute()); |
|
101 | } |
|
102 | ||
103 | private function isPaginationEnabled(Request $request, ResourceMetadata $resourceMetadata, string $operationName = null) : bool |
|
104 | { |
|
105 | $enabled = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_enabled', $this->enabled, true); |
|
106 | $clientEnabled = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_client_enabled', $this->clientEnabled, true); |
|
107 | ||
108 | if ($clientEnabled) { |
|
109 | $enabled = filter_var($request->query->get($this->enabledParameterName, $enabled), FILTER_VALIDATE_BOOLEAN); |
|
110 | } |
|
111 | ||
112 | return $enabled; |
|
113 | } |
|
114 | } |
|
115 |
@@ 112-122 (lines=11) @@ | ||
109 | return new Paginator($doctrineOrmPaginator); |
|
110 | } |
|
111 | ||
112 | private function isPaginationEnabled(Request $request, ResourceMetadata $resourceMetadata, string $operationName = null): bool |
|
113 | { |
|
114 | $enabled = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_enabled', $this->enabled, true); |
|
115 | $clientEnabled = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_client_enabled', $this->clientEnabled, true); |
|
116 | ||
117 | if ($clientEnabled) { |
|
118 | $enabled = filter_var($request->query->get($this->enabledParameterName, $enabled), FILTER_VALIDATE_BOOLEAN); |
|
119 | } |
|
120 | ||
121 | return $enabled; |
|
122 | } |
|
123 | ||
124 | /** |
|
125 | * Determines whether the Paginator should fetch join collections, if the root entity uses composite identifiers it should not. |