Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

36 rindas
970B

  1. <?php
  2. namespace domain\Communication\AutomaticEmail;
  3. use domain\_\AbstractManager;
  4. use domain\Producer\Producer\Producer;
  5. class AutomaticEmailManager extends AbstractManager
  6. {
  7. protected AutomaticEmailBuilder $automaticEmailBuilder;
  8. public function loadDependencies(): void
  9. {
  10. $this->automaticEmailBuilder = $this->loadService(AutomaticEmailBuilder::class);
  11. }
  12. public function createAutomaticEmail(
  13. Producer $producer,
  14. int $day,
  15. string $subject,
  16. string $message,
  17. bool $integrateProductList = null
  18. ): AutomaticEmail
  19. {
  20. $automaticEmail = $this->automaticEmailBuilder->instanciateAutomaticEmail($producer);
  21. $automaticEmail->setDay($day);
  22. $automaticEmail->setSubject($subject);
  23. $automaticEmail->setMessage($message);
  24. $automaticEmail->setIntegrateProductList($integrateProductList);
  25. $automaticEmail->save();
  26. return $automaticEmail;
  27. }
  28. }