From 66a1d65df77c1fe0f764609fc2541c834d606ba1 Mon Sep 17 00:00:00 2001 From: rs2487 Date: Fri, 25 Sep 2020 11:32:38 +0200 Subject: [PATCH] Added tracked flag to variant stock query --- .../LoadProductVariantStockQueryHandler.php | 1 + .../Query/LoadProductVariantStockQuery.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Model/Product/Handler/Query/LoadProductVariantStockQueryHandler.php b/Model/Product/Handler/Query/LoadProductVariantStockQueryHandler.php index 19e38e42..e1615962 100644 --- a/Model/Product/Handler/Query/LoadProductVariantStockQueryHandler.php +++ b/Model/Product/Handler/Query/LoadProductVariantStockQueryHandler.php @@ -37,5 +37,6 @@ public function __invoke(LoadProductVariantStockQuery $query): void $query->setOnHand($variantData['onHand']); $query->setOnHold($variantData['onHold']); + $query->setTracked($variantData['tracked']); } } diff --git a/Model/Product/Query/LoadProductVariantStockQuery.php b/Model/Product/Query/LoadProductVariantStockQuery.php index ea34a7e0..e0516501 100644 --- a/Model/Product/Query/LoadProductVariantStockQuery.php +++ b/Model/Product/Query/LoadProductVariantStockQuery.php @@ -35,6 +35,11 @@ class LoadProductVariantStockQuery */ private $onHand; + /** + * @var bool|null + */ + private $tracked; + public function __construct(string $code, string $variantCode) { $this->code = $code; @@ -74,4 +79,16 @@ public function setOnHand(?int $onHand): self return $this; } + + public function isTracked(): ?bool + { + return $this->tracked; + } + + public function setTracked(?bool $tracked): self + { + $this->tracked = $tracked; + + return $this; + } }