src/Entity/CRM/MailAction.php line 10

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\MailTemplate;
  4. use App\Repository\MailActionRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassMailActionRepository::class)]
  7. class MailAction
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column(length255)]
  14.     private ?string $name null;
  15.     #[ORM\Column]
  16.     private ?bool $isActive null;
  17.     #[ORM\OneToOne(mappedBy'action'cascade: ['persist''remove'])]
  18.     private ?MailTemplate $mailTemplate null;
  19.     public function __toString(): string
  20.     {
  21.         return $this->getName();
  22.     }
  23.     public function getId(): ?int
  24.     {
  25.         return $this->id;
  26.     }
  27.     public function getName(): ?string
  28.     {
  29.         return $this->name;
  30.     }
  31.     public function setName(string $name): self
  32.     {
  33.         $this->name $name;
  34.         return $this;
  35.     }
  36.     public function isIsActive(): ?bool
  37.     {
  38.         return $this->isActive;
  39.     }
  40.     public function setIsActive(bool $isActive): self
  41.     {
  42.         $this->isActive $isActive;
  43.         return $this;
  44.     }
  45.     public function getMailTemplate(): ?MailTemplate
  46.     {
  47.         return $this->mailTemplate;
  48.     }
  49.     public function setMailTemplate(?MailTemplate $mailTemplate): self
  50.     {
  51.         // unset the owning side of the relation if necessary
  52.         if ($mailTemplate === null && $this->mailTemplate !== null) {
  53.             $this->mailTemplate->setAction(null);
  54.         }
  55.         // set the owning side of the relation if necessary
  56.         if ($mailTemplate !== null && $mailTemplate->getAction() !== $this) {
  57.             $mailTemplate->setAction($this);
  58.         }
  59.         $this->mailTemplate $mailTemplate;
  60.         return $this;
  61.     }
  62. }