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