From 6a9c46ad492bcf0adba5bd2ea04a96ce82022f9b Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Fri, 25 Oct 2024 11:56:26 +0200 Subject: [PATCH] Added RelationListIteratorAdapter --- .../RelationListIteratorAdapter.php | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/contracts/Repository/Iterator/BatchIteratorAdapter/RelationListIteratorAdapter.php diff --git a/src/contracts/Repository/Iterator/BatchIteratorAdapter/RelationListIteratorAdapter.php b/src/contracts/Repository/Iterator/BatchIteratorAdapter/RelationListIteratorAdapter.php new file mode 100644 index 0000000000..38ee471fda --- /dev/null +++ b/src/contracts/Repository/Iterator/BatchIteratorAdapter/RelationListIteratorAdapter.php @@ -0,0 +1,42 @@ +contentService->loadRelationList( + $this->versionInfo, + $offset, + $limit, + $this->relationType + )->getIterator(); + + if ($iterator instanceof Iterator) { + return $iterator; + } + + return new IteratorIterator($iterator); + } +}