|
123456789101112131415161718192021222324252627282930 |
- <?php
-
- namespace common\logic\Product\ProductPointSale;
-
- use common\logic\BaseBuilder;
- use common\logic\BuilderInterface;
- use common\logic\PointSale\PointSale\PointSale;
- use common\logic\Product\Product\Product;
-
- class ProductPointSaleBuilder extends BaseBuilder implements BuilderInterface
- {
- public function instanciateProductPointSale(): ProductPointSale
- {
- $productPointSale = new ProductPointSale();
-
- return $productPointSale;
- }
-
- public function createProductPointSale(Product $product, PointSale $pointSale, bool $available): ProductPointSale
- {
- $productPointSale = $this->instanciateProductPointSale();
- $productPointSale->populateProduct($product);
- $productPointSale->populatePointSale($pointSale);
- $productPointSale->availability = $available;
-
- $this->saveCreate($productPointSale);
-
- return $productPointSale;
- }
- }
|