You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProductPointSaleBuilder.php 826B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace domain\Product\ProductPointSale;
  3. use domain\PointSale\PointSale\PointSale;
  4. use domain\Product\Product\Product;
  5. use domain\_\AbstractBuilder;
  6. class ProductPointSaleBuilder extends AbstractBuilder
  7. {
  8. public function instanciateProductPointSale(): ProductPointSale
  9. {
  10. $productPointSale = new ProductPointSale();
  11. return $productPointSale;
  12. }
  13. public function createProductPointSale(Product $product, PointSale $pointSale, bool $available): ProductPointSale
  14. {
  15. $productPointSale = $this->instanciateProductPointSale();
  16. $productPointSale->populateProduct($product);
  17. $productPointSale->populatePointSale($pointSale);
  18. $productPointSale->available = $available;
  19. $this->saveCreate($productPointSale);
  20. return $productPointSale;
  21. }
  22. }