MessageEvent.php 893 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Notifier\Event;
  11. use Symfony\Component\Notifier\Message\MessageInterface;
  12. use Symfony\Contracts\EventDispatcher\Event;
  13. /**
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. *
  16. * @experimental in 5.1
  17. */
  18. final class MessageEvent extends Event
  19. {
  20. private $message;
  21. private $queued;
  22. public function __construct(MessageInterface $message, bool $queued = false)
  23. {
  24. $this->message = $message;
  25. $this->queued = $queued;
  26. }
  27. public function getMessage(): MessageInterface
  28. {
  29. return $this->message;
  30. }
  31. public function isQueued(): bool
  32. {
  33. return $this->queued;
  34. }
  35. }