diff --git a/Changelog.md b/Changelog.md index a25ef4a1..4551ed44 100644 --- a/Changelog.md +++ b/Changelog.md @@ -60,6 +60,8 @@ - Added the `Address` DTO class (implements the `Address` interface) - Added the `AdjusterAliases` class that for decoupling FQCNs from the database - Added automatic mapping of adjuster FQCN <-> aliases when saving an adjustment into the DB and when calling the `getAdjuster()` method +- BC: Added the `findBySku()` method to the `Product` and `MasterProductVariant` interfaces +- BC: The `MasterProduct` interface no longer extends the `Product` interface - BC: The `Checkout` interface now extends the `ArrayAccess` and the `Shippable` interfaces (until here, only the concrete classes have implementation it) - BC: Added cart and order item models to the Relation morph map: the `adjustable_type` field in the `adjustments` table needs to be converted! - BC: Added the `?CheckoutSubject` return type to the `getCart()` method of the `Checkout` interface diff --git a/src/MasterProduct/Changelog.md b/src/MasterProduct/Changelog.md index 29e538ba..9d0a9be1 100644 --- a/src/MasterProduct/Changelog.md +++ b/src/MasterProduct/Changelog.md @@ -14,6 +14,9 @@ - Changed minimal Enum requirement to v4.2 - Added the `Stockable` interface to the `MasterProductVariant` Model - Added the `backorder` field to product variants +- BC: Added the `findBySku()` method to the `MasterProductVariant` interface +- BC: The `MasterProduct` interface no longer extends the `Product` interface + ## 3.x Series diff --git a/src/MasterProduct/Contracts/MasterProduct.php b/src/MasterProduct/Contracts/MasterProduct.php index 49a45f23..67655365 100644 --- a/src/MasterProduct/Contracts/MasterProduct.php +++ b/src/MasterProduct/Contracts/MasterProduct.php @@ -16,13 +16,16 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; -use Vanilo\Product\Contracts\Product; /** * @property-read Collection|MasterProductVariant[] $variants */ -interface MasterProduct extends Product +interface MasterProduct { + public function isActive(): bool; + + public function title(): string; + public function variants(): HasMany; public function createVariant(array $attributes): MasterProductVariant; diff --git a/src/MasterProduct/Contracts/MasterProductVariant.php b/src/MasterProduct/Contracts/MasterProductVariant.php index 23a63029..bf395597 100644 --- a/src/MasterProduct/Contracts/MasterProductVariant.php +++ b/src/MasterProduct/Contracts/MasterProductVariant.php @@ -16,4 +16,5 @@ interface MasterProductVariant { + public static function findBySku(string $sku): ?MasterProductVariant; }