src/Entity/Mailing/MailingContact.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Mailing;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\AbstractBase;
  5. use App\Entity\Garages\Garage;
  6. use App\Entity\Interfaces\SiteInterface;
  7. use App\Entity\Province;
  8. use App\Entity\Traits\NameTrait;
  9. use App\Entity\Traits\SiteTrait;
  10. use App\Repository\Mailing\MailingContactRepository;
  11. use DateTimeInterface;
  12. use Doctrine\ORM\Mapping as ORM;
  13. /**
  14.  * @ORM\Table(name="vulco_mailing_contact", indexes={@ORM\Index(name="mailing_contact_site_idx", columns={"site"})})
  15.  * @ORM\Entity(repositoryClass=MailingContactRepository::class)
  16.  * @SiteAware(siteFieldName="site")
  17.  */
  18. class MailingContact extends AbstractBase implements SiteInterface
  19. {
  20.     use SiteTrait;
  21.     use NameTrait;
  22.     protected ?DateTimeInterface $removedAt null// Keep it here only to avoid unnecessary superclass ORM definition
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=false)
  25.      */
  26.     private string $name;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=false, unique=true)
  29.      */
  30.     private string $email;
  31.     /**
  32.      * @ORM\Column(type="boolean", nullable=false, options={"default": 0})
  33.      */
  34.     private bool $interestedInTyres false;
  35.     /**
  36.      * @ORM\Column(type="boolean", nullable=false, options={"default": 0})
  37.      */
  38.     private bool $interestedInFastRepairs false;
  39.     /**
  40.      * @ORM\Column(type="boolean", nullable=true, options={"default": 0})
  41.      */
  42.     private ?bool $belongsToGarage false;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity="App\Entity\Garages\Garage", fetch="EAGER")
  45.      * @ORM\JoinColumn(name="preferred_garage_id", referencedColumnName="id")
  46.      */
  47.     private Garage $preferredGarage;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity="App\Entity\Province", fetch="EAGER")
  50.      * @ORM\JoinColumn(name="province_id", referencedColumnName="id")
  51.      */
  52.     private Province $province;
  53.     public function getEmail(): string
  54.     {
  55.         return $this->email;
  56.     }
  57.     public function setEmail(string $email): self
  58.     {
  59.         $this->email $email;
  60.         return $this;
  61.     }
  62.     public function isInterestedInTyres(): bool
  63.     {
  64.         return $this->interestedInTyres;
  65.     }
  66.     public function setInterestedInTyres(bool $interestedInTyres): self
  67.     {
  68.         $this->interestedInTyres $interestedInTyres;
  69.         return $this;
  70.     }
  71.     public function isInterestedInFastRepairs(): bool
  72.     {
  73.         return $this->interestedInFastRepairs;
  74.     }
  75.     public function setInterestedInFastRepairs(bool $interestedInFastRepairs): self
  76.     {
  77.         $this->interestedInFastRepairs $interestedInFastRepairs;
  78.         return $this;
  79.     }
  80.     public function getBelongsToGarage(): ?bool
  81.     {
  82.         return $this->belongsToGarage;
  83.     }
  84.     public function setBelongsToGarage(?bool $belongsToGarage): self
  85.     {
  86.         $this->belongsToGarage $belongsToGarage;
  87.         return $this;
  88.     }
  89.     public function getPreferredGarage(): Garage
  90.     {
  91.         return $this->preferredGarage;
  92.     }
  93.     public function setPreferredGarage(Garage $preferredGarage): self
  94.     {
  95.         $this->preferredGarage $preferredGarage;
  96.         return $this;
  97.     }
  98.     public function getProvince(): Province
  99.     {
  100.         return $this->province;
  101.     }
  102.     public function setProvince(Province $province): self
  103.     {
  104.         $this->province $province;
  105.         return $this;
  106.     }
  107. }