Skip to content

Commit

Permalink
Removed unnecessary BC code from the REST controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertrand Dunogier committed Feb 6, 2020
1 parent a314825 commit 5278f5f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/Controller/QueryFieldRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getResults(Request $request, $contentId, $versionNumber, $fieldD
$items = $this->queryFieldService->loadContentItemsSlice($content, $fieldDefinitionIdentifier, $offset, $limit);
}

$list = new ContentList(
return new ContentList(
array_map(
function (Content $content) {
return new RestContent(
Expand All @@ -67,14 +67,9 @@ function (Content $content) {
);
},
$items
)
),
$this->queryFieldService->countContentItems($content, $fieldDefinitionIdentifier)
);

if (property_exists($list, 'totalCount')) {
$list->totalCount = $this->queryFieldService->countContentItems($content, $fieldDefinitionIdentifier);
}

return $list;
}

private function getContentType(ContentInfo $contentInfo): ContentType
Expand Down

0 comments on commit 5278f5f

Please sign in to comment.