src/Entity/JoinTheNetwork/JoinTheNetwork.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Entity\JoinTheNetwork;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\AbstractBase;
  5. use App\Entity\Interfaces\SiteInterface;
  6. use App\Entity\MiniAbstractBase;
  7. use App\Entity\Province;
  8. use App\Entity\Traits\NameTrait;
  9. use App\Entity\Traits\PhoneTrait;
  10. use App\Entity\Traits\SiteTrait;
  11. use App\Enum\CurrentActivityEnum;
  12. use App\Enum\DirectedServicesToEnum;
  13. use App\Enum\HasLocalEnum;
  14. use App\Enum\JoinTheNetworkStatusEnum;
  15. use App\Repository\JoinTheNetwork\JoinTheNetworkRepository;
  16. use Doctrine\ORM\Mapping as ORM;
  17. use Gedmo\Mapping\Annotation as Gedmo;
  18. /**
  19.  * @ORM\Table(name="vulco_join_the_network", indexes={@ORM\Index(name="join_the_network_site_idx", columns={"site"})})
  20.  *
  21.  * @ORM\Entity(repositoryClass=JoinTheNetworkRepository::class)
  22.  *
  23.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  24.  *
  25.  * @SiteAware(siteFieldName="site")
  26.  */
  27. class JoinTheNetwork extends AbstractBase implements SiteInterface
  28. {
  29.     use NameTrait;
  30.     use PhoneTrait;
  31.     use SiteTrait;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=false)
  34.      */
  35.     private string $name;
  36.     /**
  37.      * @ORM\Column(type="string", length=255, nullable=false)
  38.      */
  39.     private string $surnames;
  40.     /**
  41.      * @ORM\Column(type="date", nullable=false)
  42.      */
  43.     private \DateTimeInterface $birthOn;
  44.     /**
  45.      * @ORM\Column(type="string", length=255, nullable=false)
  46.      */
  47.     private string $garageName;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=false)
  50.      */
  51.     private string $address;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=false)
  54.      */
  55.     private string $locality;
  56.     /**
  57.      * @ORM\Column(type="string", length=255, nullable=false)
  58.      */
  59.     protected string $zipCode;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity="App\Entity\Province")
  62.      *
  63.      * @ORM\JoinColumn(name="province_id", referencedColumnName="id")
  64.      */
  65.     private Province $province;
  66.     /**
  67.      * @ORM\Column(type="string", length=255, nullable=false)
  68.      */
  69.     private string $email;
  70.     /**
  71.      * @ORM\Column(type="boolean", nullable=false)
  72.      */
  73.     private bool $isGoodyearClient;
  74.     /**
  75.      * @ORM\Column(type="string", length=255, nullable=false)
  76.      */
  77.     private string $networkGarage;
  78.     /**
  79.      * @ORM\Column(type="integer", nullable=false)
  80.      */
  81.     private int $hasLocal;
  82.     /**
  83.      * @ORM\Column(type="string", length=255, nullable=true)
  84.      */
  85.     private ?string $squareMeter null;
  86.     /**
  87.      * @ORM\Column(type="integer", nullable=true)
  88.      */
  89.     private ?int $currentActivity;
  90.     /**
  91.      * @ORM\Column(type="array", nullable=true)
  92.      */
  93.     private ?array $directedServicesTo;
  94.     /**
  95.      * @ORM\Column(type="string", length=255, nullable=true)
  96.      */
  97.     private ?string $tiresChangesYear null;
  98.     /**
  99.      * @ORM\Column(type="text", length=10000, nullable=true)
  100.      */
  101.     private ?string $message null;
  102.     /**
  103.      * @ORM\Column(type="integer", nullable=false, options={"default": 0})
  104.      */
  105.     private int $status 0;
  106.     /**
  107.      * @ORM\Column(type="text", length=10000, nullable=true)
  108.      */
  109.     private ?string $observations null;
  110.     public function __construct()
  111.     {
  112.     }
  113.     public function getSurnames(): string
  114.     {
  115.         return $this->surnames;
  116.     }
  117.     public function setSurnames(string $surnames): self
  118.     {
  119.         $this->surnames $surnames;
  120.         return $this;
  121.     }
  122.     public function getBirthOn(): \DateTimeInterface
  123.     {
  124.         return $this->birthOn;
  125.     }
  126.     public function getBirthOnAsString(): string
  127.     {
  128.         return $this->getDateTimeAsString($this->getBirthOn());
  129.     }
  130.     public function getBirthOnAsStringWithoutTime(): string
  131.     {
  132.         return $this->getDateAsString($this->getBirthOn());
  133.     }
  134.     public function setBirthOn(\DateTimeInterface $birthOn): self
  135.     {
  136.         $this->birthOn $birthOn;
  137.         return $this;
  138.     }
  139.     public function getGarageName(): string
  140.     {
  141.         return $this->garageName;
  142.     }
  143.     public function setGarageName(string $garageName): self
  144.     {
  145.         $this->garageName $garageName;
  146.         return $this;
  147.     }
  148.     public function getAddress(): string
  149.     {
  150.         return $this->address;
  151.     }
  152.     public function setAddress(string $address): self
  153.     {
  154.         $this->address $address;
  155.         return $this;
  156.     }
  157.     public function getLocality(): string
  158.     {
  159.         return $this->locality;
  160.     }
  161.     public function setLocality(string $locality): self
  162.     {
  163.         $this->locality $locality;
  164.         return $this;
  165.     }
  166.     public function getZipCode(): string
  167.     {
  168.         return $this->zipCode;
  169.     }
  170.     public function setZipCode(string $zipCode): self
  171.     {
  172.         $this->zipCode $zipCode;
  173.         return $this;
  174.     }
  175.     public function getProvince(): Province
  176.     {
  177.         return $this->province;
  178.     }
  179.     public function setProvince(Province $province): self
  180.     {
  181.         $this->province $province;
  182.         return $this;
  183.     }
  184.     public function getEmail(): string
  185.     {
  186.         return $this->email;
  187.     }
  188.     public function setEmail(string $email): self
  189.     {
  190.         $this->email $email;
  191.         return $this;
  192.     }
  193.     public function isIsGoodyearClient(): bool
  194.     {
  195.         return $this->isGoodyearClient;
  196.     }
  197.     public function getIsGoodyearClient(): bool
  198.     {
  199.         return $this->isIsGoodyearClient();
  200.     }
  201.     public function setIsGoodyearClient(bool $isGoodyearClient): self
  202.     {
  203.         $this->isGoodyearClient $isGoodyearClient;
  204.         return $this;
  205.     }
  206.     public function getNetworkGarage(): string
  207.     {
  208.         return $this->networkGarage;
  209.     }
  210.     public function setNetworkGarage(string $networkGarage): self
  211.     {
  212.         $this->networkGarage $networkGarage;
  213.         return $this;
  214.     }
  215.     public function getHasLocal(): int
  216.     {
  217.         return $this->hasLocal;
  218.     }
  219.     public function getHasLocalString(): string
  220.     {
  221.         return HasLocalEnum::getReversedTranslations()[$this->getHasLocal()];
  222.     }
  223.     public function setHasLocal(int $hasLocal): self
  224.     {
  225.         $this->hasLocal $hasLocal;
  226.         return $this;
  227.     }
  228.     public function getSquareMeter(): ?string
  229.     {
  230.         return $this->squareMeter;
  231.     }
  232.     public function setSquareMeter(?string $squareMeter): self
  233.     {
  234.         $this->squareMeter $squareMeter;
  235.         return $this;
  236.     }
  237.     public function getCurrentActivity(): ?int
  238.     {
  239.         if (is_null($this->currentActivity)) {
  240.             return 0;
  241.         }
  242.         return $this->currentActivity;
  243.     }
  244.     public function getCurrentActivityString(): string
  245.     {
  246.         return CurrentActivityEnum::getReversedTranslations()[$this->getCurrentActivity()];
  247.     }
  248.     public function setCurrentActivity(?int $currentActivity): self
  249.     {
  250.         $this->currentActivity $currentActivity;
  251.         return $this;
  252.     }
  253.     public function getDirectedServicesTo(): ?array
  254.     {
  255.         return $this->directedServicesTo;
  256.     }
  257.     public function setDirectedServicesTo(?array $directedServicesTo): self
  258.     {
  259.         $this->directedServicesTo $directedServicesTo;
  260.         return $this;
  261.     }
  262.     public function addDirectedServicesTo($value): self
  263.     {
  264.         if (!in_array($value$this->directedServicesTotrue)) {
  265.             $this->directedServicesTo[] = $value;
  266.         }
  267.         return $this;
  268.     }
  269.     public function hasDirectedServicesTo($value): bool
  270.     {
  271.         return in_array(strtoupper($value), $this->getDirectedServicesTo(), true);
  272.     }
  273.     public function getDirectedServicesToTranslations(): array
  274.     {
  275.         $translationsArray = [];
  276.         if (!is_null($this->getDirectedServicesTo())) {
  277.             foreach ($this->getDirectedServicesTo() as $value) {
  278.                 $translationsArray[] = DirectedServicesToEnum::getReversedTranslations()[$value];
  279.             }
  280.         }
  281.         return $translationsArray;
  282.     }
  283.     public function getTiresChangesYear(): ?string
  284.     {
  285.         return $this->tiresChangesYear;
  286.     }
  287.     public function setTiresChangesYear(?string $tiresChangesYear): self
  288.     {
  289.         $this->tiresChangesYear $tiresChangesYear;
  290.         return $this;
  291.     }
  292.     public function getMessage(): ?string
  293.     {
  294.         return $this->message;
  295.     }
  296.     public function setMessage(?string $message): self
  297.     {
  298.         $this->message $message;
  299.         return $this;
  300.     }
  301.     public function getStatus(): int
  302.     {
  303.         return $this->status;
  304.     }
  305.     public function getStatusString(): string
  306.     {
  307.         return JoinTheNetworkStatusEnum::getReversedTranslations()[$this->getStatus()];
  308.     }
  309.     public function setStatus(int $status): self
  310.     {
  311.         $this->status $status;
  312.         return $this;
  313.     }
  314.     public function getObservations(): ?string
  315.     {
  316.         return $this->observations;
  317.     }
  318.     public function setObservations(?string $observations): self
  319.     {
  320.         $this->observations $observations;
  321.         return $this;
  322.     }
  323.     public function __toString(): string
  324.     {
  325.         return $this->id $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  326.     }
  327. }