Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SharedPointSaleManager.php 1.4KB

7 месяцев назад
7 месяцев назад
7 месяцев назад
7 месяцев назад
7 месяцев назад
7 месяцев назад
12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace domain\PointSale\SharedPointSale;
  3. use domain\_\AbstractManager;
  4. use domain\PointSale\PointSale\PointSale;
  5. use domain\Producer\Producer\Producer;
  6. use domain\User\User\User;
  7. class SharedPointSaleManager extends AbstractManager
  8. {
  9. protected SharedPointSaleBuilder $sharedPointSaleBuilder;
  10. public function loadDependencies(): void
  11. {
  12. $this->sharedPointSaleBuilder = $this->loadService(SharedPointSaleBuilder::class);
  13. }
  14. public function createSharedPointSale(PointSale $pointSale, Producer $producerWithSharing, User $createdBy): SharedPointSale
  15. {
  16. $sharedPointSale = $this->sharedPointSaleBuilder->instanciateSharedPointSale($pointSale, $producerWithSharing, $createdBy);
  17. $this->sharedPointSaleBuilder->create($sharedPointSale);
  18. return $sharedPointSale;
  19. }
  20. public function confirmSharedPointSale(SharedPointSale $sharedPointSale, PointSale $pointSaleWithSharing, User $confirmedBy): bool
  21. {
  22. $this->sharedPointSaleBuilder->initConfirmSharedPointSale($sharedPointSale, $pointSaleWithSharing, $confirmedBy);
  23. return $this->sharedPointSaleBuilder->update($sharedPointSale);
  24. }
  25. public function declineSharedPointSale(SharedPointSale $sharedPointSale, User $declinedBy): bool
  26. {
  27. $this->sharedPointSaleBuilder->initDeclineSharedPointSale($sharedPointSale, $declinedBy);
  28. return $this->sharedPointSaleBuilder->update($sharedPointSale);
  29. }
  30. }