diff --git a/src/bundle/Core/Resources/config/helpers.yml b/src/bundle/Core/Resources/config/helpers.yml index 1ea501e559..9f7d8ce313 100644 --- a/src/bundle/Core/Resources/config/helpers.yml +++ b/src/bundle/Core/Resources/config/helpers.yml @@ -65,3 +65,7 @@ services: Ibexa\Bundle\Core\SiteAccess\Config\IOConfigResolver: arguments: $complexConfigProcessor: '@Ibexa\Bundle\Core\SiteAccess\Config\ComplexConfigProcessor' + + Ibexa\Core\Helper\RelationListHelper: + arguments: + $contentService: '@ibexa.api.service.content' diff --git a/src/lib/Helper/RelationListHelper.php b/src/lib/Helper/RelationListHelper.php new file mode 100644 index 0000000000..4a6cfdb209 --- /dev/null +++ b/src/lib/Helper/RelationListHelper.php @@ -0,0 +1,45 @@ +contentService, + $versionInfo + ) + ); + + $relations = []; + /** @var \Ibexa\Contracts\Core\Repository\Values\Content\RelationList\RelationListItemInterface $relationListItem */ + foreach ($relationListIterator as $relationListItem) { + if ($relationListItem->hasRelation()) { + $relations[] = $relationListItem->getRelation(); + } + } + + return $relations; + } +}