<?php
namespace App\Entity\Mailing;
use App\Annotation\SiteAware;
use App\Entity\AbstractBase;
use App\Entity\Garages\Garage;
use App\Entity\Interfaces\SiteInterface;
use App\Entity\Province;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\SiteTrait;
use App\Repository\Mailing\MailingContactRepository;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="vulco_mailing_contact", indexes={@ORM\Index(name="mailing_contact_site_idx", columns={"site"})})
* @ORM\Entity(repositoryClass=MailingContactRepository::class)
* @SiteAware(siteFieldName="site")
*/
class MailingContact extends AbstractBase implements SiteInterface
{
use SiteTrait;
use NameTrait;
protected ?DateTimeInterface $removedAt = null; // Keep it here only to avoid unnecessary superclass ORM definition
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $name;
/**
* @ORM\Column(type="string", length=255, nullable=false, unique=true)
*/
private string $email;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default": 0})
*/
private bool $interestedInTyres = false;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default": 0})
*/
private bool $interestedInFastRepairs = false;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": 0})
*/
private ?bool $belongsToGarage = false;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Garages\Garage", fetch="EAGER")
* @ORM\JoinColumn(name="preferred_garage_id", referencedColumnName="id")
*/
private Garage $preferredGarage;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Province", fetch="EAGER")
* @ORM\JoinColumn(name="province_id", referencedColumnName="id")
*/
private Province $province;
public function getEmail(): string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function isInterestedInTyres(): bool
{
return $this->interestedInTyres;
}
public function setInterestedInTyres(bool $interestedInTyres): self
{
$this->interestedInTyres = $interestedInTyres;
return $this;
}
public function isInterestedInFastRepairs(): bool
{
return $this->interestedInFastRepairs;
}
public function setInterestedInFastRepairs(bool $interestedInFastRepairs): self
{
$this->interestedInFastRepairs = $interestedInFastRepairs;
return $this;
}
public function getBelongsToGarage(): ?bool
{
return $this->belongsToGarage;
}
public function setBelongsToGarage(?bool $belongsToGarage): self
{
$this->belongsToGarage = $belongsToGarage;
return $this;
}
public function getPreferredGarage(): Garage
{
return $this->preferredGarage;
}
public function setPreferredGarage(Garage $preferredGarage): self
{
$this->preferredGarage = $preferredGarage;
return $this;
}
public function getProvince(): Province
{
return $this->province;
}
public function setProvince(Province $province): self
{
$this->province = $province;
return $this;
}
}