<?php
namespace App\Entity\JoinTheNetwork;
use App\Annotation\SiteAware;
use App\Entity\AbstractBase;
use App\Entity\Interfaces\SiteInterface;
use App\Entity\MiniAbstractBase;
use App\Entity\Province;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\PhoneTrait;
use App\Entity\Traits\SiteTrait;
use App\Enum\CurrentActivityEnum;
use App\Enum\DirectedServicesToEnum;
use App\Enum\HasLocalEnum;
use App\Enum\JoinTheNetworkStatusEnum;
use App\Repository\JoinTheNetwork\JoinTheNetworkRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Table(name="vulco_join_the_network", indexes={@ORM\Index(name="join_the_network_site_idx", columns={"site"})})
*
* @ORM\Entity(repositoryClass=JoinTheNetworkRepository::class)
*
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
*
* @SiteAware(siteFieldName="site")
*/
class JoinTheNetwork extends AbstractBase implements SiteInterface
{
use NameTrait;
use PhoneTrait;
use SiteTrait;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $name;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $surnames;
/**
* @ORM\Column(type="date", nullable=false)
*/
private \DateTimeInterface $birthOn;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $garageName;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $address;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $locality;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
protected string $zipCode;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Province")
*
* @ORM\JoinColumn(name="province_id", referencedColumnName="id")
*/
private Province $province;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $email;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private bool $isGoodyearClient;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $networkGarage;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private int $hasLocal;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $squareMeter = null;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $currentActivity;
/**
* @ORM\Column(type="array", nullable=true)
*/
private ?array $directedServicesTo;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $tiresChangesYear = null;
/**
* @ORM\Column(type="text", length=10000, nullable=true)
*/
private ?string $message = null;
/**
* @ORM\Column(type="integer", nullable=false, options={"default": 0})
*/
private int $status = 0;
/**
* @ORM\Column(type="text", length=10000, nullable=true)
*/
private ?string $observations = null;
public function __construct()
{
}
public function getSurnames(): string
{
return $this->surnames;
}
public function setSurnames(string $surnames): self
{
$this->surnames = $surnames;
return $this;
}
public function getBirthOn(): \DateTimeInterface
{
return $this->birthOn;
}
public function getBirthOnAsString(): string
{
return $this->getDateTimeAsString($this->getBirthOn());
}
public function getBirthOnAsStringWithoutTime(): string
{
return $this->getDateAsString($this->getBirthOn());
}
public function setBirthOn(\DateTimeInterface $birthOn): self
{
$this->birthOn = $birthOn;
return $this;
}
public function getGarageName(): string
{
return $this->garageName;
}
public function setGarageName(string $garageName): self
{
$this->garageName = $garageName;
return $this;
}
public function getAddress(): string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
public function getLocality(): string
{
return $this->locality;
}
public function setLocality(string $locality): self
{
$this->locality = $locality;
return $this;
}
public function getZipCode(): string
{
return $this->zipCode;
}
public function setZipCode(string $zipCode): self
{
$this->zipCode = $zipCode;
return $this;
}
public function getProvince(): Province
{
return $this->province;
}
public function setProvince(Province $province): self
{
$this->province = $province;
return $this;
}
public function getEmail(): string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function isIsGoodyearClient(): bool
{
return $this->isGoodyearClient;
}
public function getIsGoodyearClient(): bool
{
return $this->isIsGoodyearClient();
}
public function setIsGoodyearClient(bool $isGoodyearClient): self
{
$this->isGoodyearClient = $isGoodyearClient;
return $this;
}
public function getNetworkGarage(): string
{
return $this->networkGarage;
}
public function setNetworkGarage(string $networkGarage): self
{
$this->networkGarage = $networkGarage;
return $this;
}
public function getHasLocal(): int
{
return $this->hasLocal;
}
public function getHasLocalString(): string
{
return HasLocalEnum::getReversedTranslations()[$this->getHasLocal()];
}
public function setHasLocal(int $hasLocal): self
{
$this->hasLocal = $hasLocal;
return $this;
}
public function getSquareMeter(): ?string
{
return $this->squareMeter;
}
public function setSquareMeter(?string $squareMeter): self
{
$this->squareMeter = $squareMeter;
return $this;
}
public function getCurrentActivity(): ?int
{
if (is_null($this->currentActivity)) {
return 0;
}
return $this->currentActivity;
}
public function getCurrentActivityString(): string
{
return CurrentActivityEnum::getReversedTranslations()[$this->getCurrentActivity()];
}
public function setCurrentActivity(?int $currentActivity): self
{
$this->currentActivity = $currentActivity;
return $this;
}
public function getDirectedServicesTo(): ?array
{
return $this->directedServicesTo;
}
public function setDirectedServicesTo(?array $directedServicesTo): self
{
$this->directedServicesTo = $directedServicesTo;
return $this;
}
public function addDirectedServicesTo($value): self
{
if (!in_array($value, $this->directedServicesTo, true)) {
$this->directedServicesTo[] = $value;
}
return $this;
}
public function hasDirectedServicesTo($value): bool
{
return in_array(strtoupper($value), $this->getDirectedServicesTo(), true);
}
public function getDirectedServicesToTranslations(): array
{
$translationsArray = [];
if (!is_null($this->getDirectedServicesTo())) {
foreach ($this->getDirectedServicesTo() as $value) {
$translationsArray[] = DirectedServicesToEnum::getReversedTranslations()[$value];
}
}
return $translationsArray;
}
public function getTiresChangesYear(): ?string
{
return $this->tiresChangesYear;
}
public function setTiresChangesYear(?string $tiresChangesYear): self
{
$this->tiresChangesYear = $tiresChangesYear;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getStatus(): int
{
return $this->status;
}
public function getStatusString(): string
{
return JoinTheNetworkStatusEnum::getReversedTranslations()[$this->getStatus()];
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getObservations(): ?string
{
return $this->observations;
}
public function setObservations(?string $observations): self
{
$this->observations = $observations;
return $this;
}
public function __toString(): string
{
return $this->id ? $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}