Skip to content

Commit 5278f5f

Browse files
author
Bertrand Dunogier
committed
Removed unnecessary BC code from the REST controller
1 parent a314825 commit 5278f5f

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/Controller/QueryFieldRestController.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getResults(Request $request, $contentId, $versionNumber, $fieldD
5555
$items = $this->queryFieldService->loadContentItemsSlice($content, $fieldDefinitionIdentifier, $offset, $limit);
5656
}
5757

58-
$list = new ContentList(
58+
return new ContentList(
5959
array_map(
6060
function (Content $content) {
6161
return new RestContent(
@@ -67,14 +67,9 @@ function (Content $content) {
6767
);
6868
},
6969
$items
70-
)
70+
),
71+
$this->queryFieldService->countContentItems($content, $fieldDefinitionIdentifier)
7172
);
72-
73-
if (property_exists($list, 'totalCount')) {
74-
$list->totalCount = $this->queryFieldService->countContentItems($content, $fieldDefinitionIdentifier);
75-
}
76-
77-
return $list;
7873
}
7974

8075
private function getContentType(ContentInfo $contentInfo): ContentType

0 commit comments

Comments
 (0)