Skip to content

Commit

Permalink
Added the RelationAdjustmentCollection::mapInto() method (proxy)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Sep 5, 2023
1 parent 98af7aa commit cd02faf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/Adjustments/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/Adjustments/Support/RelationAdjustmentCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit cd02faf

Please sign in to comment.