From d9793f51601a6538add0bf1246d3aeafa21b6da7 Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Tue, 2 Apr 2024 10:36:36 +0300 Subject: [PATCH] Added the `findBySku()` method to the `Product` interface --- src/Product/Changelog.md | 1 + src/Product/Contracts/Product.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/Product/Changelog.md b/src/Product/Changelog.md index 6ee15471..f49abdd4 100644 --- a/src/Product/Changelog.md +++ b/src/Product/Changelog.md @@ -14,6 +14,7 @@ - Changed minimal Enum requirement to v4.2 - Added the `Stockable` interface to the Product Model - Added the `backorder` field to products +- BC: Added the `findBySku()` method to the `Product` interface ## 3.x Series diff --git a/src/Product/Contracts/Product.php b/src/Product/Contracts/Product.php index 4bb1bb1e..7cc3cb17 100644 --- a/src/Product/Contracts/Product.php +++ b/src/Product/Contracts/Product.php @@ -25,4 +25,6 @@ public function isActive(): bool; * Returns the title of the product. If no `title` was given, returns the `name` of the product */ public function title(): string; + + public static function findBySku(string $sku): ?Product; }