|
1234567891011121314151617181920212223242526272829 |
- <?php
-
- namespace domain\Product\ProductPointSale;
-
- use domain\PointSale\PointSale\PointSale;
- use domain\Product\Product\Product;
- use domain\_\AbstractBuilder;
-
- class ProductPointSaleBuilder extends AbstractBuilder
- {
- 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->available = $available;
-
- $this->saveCreate($productPointSale);
-
- return $productPointSale;
- }
- }
|