src/Products/NotificationsBundle/Entity/Recipients/EmailRecipient.php line 17

Open in your IDE?
  1. <?php
  2. namespace Products\NotificationsBundle\Entity\Recipients;
  3. use Products\NotificationsBundle\Entity\AbstractRecipient;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Products\NotificationsBundle\Model\Contacts\EmailContactInterface;
  6. /**
  7.  * Class EmailRecipient
  8.  * @package Products\NotificationsBundle\Entity\Recipients
  9.  *
  10.  * @ORM\Entity(
  11.  *     repositoryClass = "Products\NotificationsBundle\Doctrine\Repository\Recipients\EmailRecipientRepository",
  12.  * )
  13.  */
  14. class EmailRecipient extends AbstractRecipient implements EmailContactInterface
  15. {
  16.     const DISCR 'email';
  17.     /**
  18.      * {@inheritDoc}
  19.      */
  20.     public function getKind(): string
  21.     {
  22.         return AbstractRecipient::KINDS__EMAIL;
  23.     }
  24.     /**
  25.      * {@inheritDoc}
  26.      */
  27.     public function getEmailAddress(): string
  28.     {
  29.         return $this->getContact();
  30.     }
  31.     /**
  32.      * {@inheritDoc}
  33.      */
  34.     public function getDisplayName(): string
  35.     {
  36.         return $this->getEmailAddress();
  37.     }
  38. }