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