您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ProductPointSaleBuilder.php 934B

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