Skip to content

Commit

Permalink
IBX-8535: Replaced usage of removed loadRelations method (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou authored Dec 19, 2024
1 parent ba53431 commit bb5f0e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
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

0 comments on commit bb5f0e5

Please sign in to comment.