From cd02fafa55c6eed93e65c45413e15683d726ef65 Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:06:17 +0300 Subject: [PATCH] Added the `RelationAdjustmentCollection::mapInto()` method (proxy) --- Changelog.md | 1 + src/Adjustments/Changelog.md | 1 + src/Adjustments/Support/RelationAdjustmentCollection.php | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/Changelog.md b/Changelog.md index fc52c1ef..859d0b21 100644 --- a/Changelog.md +++ b/Changelog.md @@ -16,6 +16,7 @@ - Added the `is_hidden` field to the `Property` model - Added the `withImages` method to the product search class (eager loads media) - Added the `channelables` table for being many-to-many polymorphic relationships with channels and arbitrary models +- Added the `mapInto()` method to the `RelationAdjustmentCollection` class, which forwards the call to the underlying Eloquent collection ## 3.x Series diff --git a/src/Adjustments/Changelog.md b/src/Adjustments/Changelog.md index f3e82f10..986defee 100644 --- a/src/Adjustments/Changelog.md +++ b/src/Adjustments/Changelog.md @@ -9,6 +9,7 @@ - Dropped Laravel 9 Support - Dropped Enum v3 Support - Changed minimal Enum requirement to v4.1 +- Added the `mapInto()` method to the `RelationAdjustmentCollection` class, which forwards the call to the underlying Eloquent collection ## 3.x Series diff --git a/src/Adjustments/Support/RelationAdjustmentCollection.php b/src/Adjustments/Support/RelationAdjustmentCollection.php index 8da4027a..3d7167ca 100644 --- a/src/Adjustments/Support/RelationAdjustmentCollection.php +++ b/src/Adjustments/Support/RelationAdjustmentCollection.php @@ -141,6 +141,11 @@ public function getIterator() return $this->eloquentCollection()->getIterator(); } + public function mapInto(string $class) + { + return $this->eloquentCollection()->mapInto($class); + } + private function relation(): MorphMany { return $this->model->adjustmentsRelation();