Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-8535: Replaced usage of removed loadRelations method #33

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
parameters:
ignoreErrors:
-
message: '#^Parameter \#1 \$href of method Ibexa\\Rest\\RequestParser\:\:parseHref\(\) expects string, string\|null given\.$#'
message: '#^Parameter \#1 \$locationId of method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:loadLocation\(\) expects int, int\|null given\.$#'
identifier: argument.type
count: 1
path: src/bundle/Controller/QueryFieldRestController.php

-
message: '#^Parameter \#1 \$locationId of method Ibexa\\Contracts\\Core\\Repository\\LocationService\:\:loadLocation\(\) expects int, int\|null given\.$#'
message: '#^Parameter \#1 \$uri of method Ibexa\\Contracts\\Rest\\UriParser\\UriParserInterface\:\:getAttributeFromUri\(\) expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/bundle/Controller/QueryFieldRestController.php
Expand Down
8 changes: 6 additions & 2 deletions src/bundle/Controller/QueryFieldRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,22 @@ final class QueryFieldRestController

private UriParserInterface $uriParser;

private ContentService\RelationListFacadeInterface $relationListFacade;

public function __construct(
QueryFieldService $queryFieldService,
ContentService $contentService,
ContentTypeService $contentTypeService,
LocationService $locationService,
UriParserInterface $uriParser
UriParserInterface $uriParser,
ContentService\RelationListFacadeInterface $relationListFacade
) {
$this->queryFieldService = $queryFieldService;
$this->contentService = $contentService;
$this->contentTypeService = $contentTypeService;
$this->locationService = $locationService;
$this->uriParser = $uriParser;
$this->relationListFacade = $relationListFacade;
}

public function getResults(
Expand Down Expand Up @@ -94,7 +98,7 @@ function (Content $content) {
$this->locationService->loadLocation($content->contentInfo->mainLocationId),
$content,
$this->getContentType($content->contentInfo),
iterator_to_array($this->contentService->loadRelations($content->getVersionInfo()))
iterator_to_array($this->relationListFacade->getRelations($content->getVersionInfo()))
);
},
iterator_to_array($items)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class QueryConverter implements Converter
* @param \Ibexa\Contracts\Core\Persistence\Content\FieldValue $value
* @param \Ibexa\Core\Persistence\Legacy\Content\StorageFieldValue $storageFieldValue
*/
public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue)
public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue): void
{
$storageFieldValue->dataText = $value->data;
$storageFieldValue->sortKeyString = (string)$value->sortKey;
Expand Down
Loading