src/Entity/Slave/TechnicianArea.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table(name="eposm_s_technician_area")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Slave\TechnicianAreaRepository")
  10.  */
  11. class TechnicianArea
  12. {
  13.     public function __toString(){
  14.         return $this->idProvince;
  15.     }
  16.     public function displayZips()
  17.     {
  18.         $string '';
  19.         $first true;
  20.         foreach($this->zips as $arrayZip){
  21.             if($first$first false; else $string.= ' - ';
  22.             $string.= $arrayZip[1];
  23.         }
  24.         return $string;
  25.     }
  26.     public function displayZipIds()
  27.     {
  28.         $string '';
  29.         $first true;
  30.         foreach($this->zips as $arrayZip){
  31.             if($first$first false; else $string.= ' ';
  32.             $string.= $arrayZip[0];
  33.         }
  34.         return $string;
  35.     }
  36.     /**
  37.      * @ORM\Column(name="id", type="bigint")
  38.      * @ORM\Id
  39.      * @ORM\GeneratedValue(strategy="AUTO")
  40.      */
  41.     protected $id;
  42.     
  43.     /**
  44.      * @ORM\Column(name="is_all_zip", type="boolean")
  45.      */
  46.     protected $allZip;
  47.     
  48.     /**
  49.      * @ORM\Column(name="id_province", type="bigint")
  50.      */
  51.     protected $idProvince;
  52.     
  53.     /**
  54.      * @ORM\Column(name="zips", type="array")
  55.      */
  56.     protected $zips;
  57.     // ManyToOne
  58.         /**
  59.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\User", inversedBy="technicianAreas")
  60.          * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  61.          */
  62.         private $user;
  63.     //
  64.     // OneToMany
  65.         /**
  66.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\JoinTableTechnicianAreaOperationTariffAmount", mappedBy="technicianArea", cascade={"persist", "remove"})
  67.          */
  68.         private $operationTariffAmounts;
  69.     //
  70.     public function __construct()
  71.     {
  72.         $this->operationTariffAmounts = new ArrayCollection();
  73.     }
  74.     public function getId(): ?string
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function isAllZip(): ?bool
  79.     {
  80.         return $this->allZip;
  81.     }
  82.     public function setAllZip(bool $allZip): static
  83.     {
  84.         $this->allZip $allZip;
  85.         return $this;
  86.     }
  87.     public function getIdProvince(): ?string
  88.     {
  89.         return $this->idProvince;
  90.     }
  91.     public function setIdProvince(string $idProvince): static
  92.     {
  93.         $this->idProvince $idProvince;
  94.         return $this;
  95.     }
  96.     public function getZips(): array
  97.     {
  98.         return $this->zips;
  99.     }
  100.     public function setZips(array $zips): static
  101.     {
  102.         $this->zips $zips;
  103.         return $this;
  104.     }
  105.     public function getUser(): ?User
  106.     {
  107.         return $this->user;
  108.     }
  109.     public function setUser(?User $user): static
  110.     {
  111.         $this->user $user;
  112.         return $this;
  113.     }
  114.     /**
  115.      * @return Collection<int, JoinTableTechnicianAreaOperationTariffAmount>
  116.      */
  117.     public function getOperationTariffAmounts(): Collection
  118.     {
  119.         return $this->operationTariffAmounts;
  120.     }
  121.     public function addOperationTariffAmount(JoinTableTechnicianAreaOperationTariffAmount $operationTariffAmount): static
  122.     {
  123.         if (!$this->operationTariffAmounts->contains($operationTariffAmount)) {
  124.             $this->operationTariffAmounts->add($operationTariffAmount);
  125.             $operationTariffAmount->setTechnicianArea($this);
  126.         }
  127.         return $this;
  128.     }
  129.     public function removeOperationTariffAmount(JoinTableTechnicianAreaOperationTariffAmount $operationTariffAmount): static
  130.     {
  131.         if ($this->operationTariffAmounts->removeElement($operationTariffAmount)) {
  132.             // set the owning side to null (unless already changed)
  133.             if ($operationTariffAmount->getTechnicianArea() === $this) {
  134.                 $operationTariffAmount->setTechnicianArea(null);
  135.             }
  136.         }
  137.         return $this;
  138.     }
  139. }