Skip to content

Commit

Permalink
Added the ProductSearch::withChannels() method
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Sep 26, 2023
1 parent 83c79ce commit 2ff6ac7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- Added the `currency` field to the orders table
- Added `currency` field to the Channel model/table
- Added the `is_hidden` field to the `Property` model
- Added the `withImages` method to the product search class (eager loads media)
- Added the `withImages` and `withChannels` methods 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
- Added the `Channelable` behavior to Foundation Product, MasterProduct, PaymentMethod, ShippingMethod and Taxonomy classes
Expand Down
8 changes: 8 additions & 0 deletions src/Foundation/Search/ProductSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ public function withImages(): self
return $this;
}

public function withChannels(): self
{
$this->productQuery->with('channels');
$this->masterProductQuery->with('channels');

return $this;
}

public function getSearcher(): Searcher
{
return $this->searcher
Expand Down

0 comments on commit 2ff6ac7

Please sign in to comment.