src/Entity/Countries.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CountriesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCountriesRepository::class)]
  8. class Countries
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'integer')]
  15.     private $phone;
  16.     #[ORM\Column(type'string'length255)]
  17.     private $code;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $name;
  20.     #[ORM\OneToMany(targetEntityDistributors::class, mappedBy'addressCountry')]
  21.     private $distributors;
  22.     #[ORM\Column(type'datetime')]
  23.     private $modified;
  24.     #[ORM\Column(type'datetime')]
  25.     private $created;
  26.     #[ORM\Column(type'integer'nullabletrue)]
  27.     private $isActive;
  28.     #[ORM\OneToMany(targetEntityClinics::class, mappedBy'country')]
  29.     private $clinics;
  30.     #[ORM\Column(type'string'length45nullabletrue)]
  31.     private $currency;
  32.     #[ORM\OneToMany(targetEntityRetailUsers::class, mappedBy'country'orphanRemovaltrue)]
  33.     private $retailUsers;
  34.     public function __construct()
  35.     {
  36.         $this->distributors = new ArrayCollection();
  37.         $this->clinics = new ArrayCollection();
  38.         $this->retailUsers = new ArrayCollection();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getPhone(): ?int
  45.     {
  46.         return $this->phone;
  47.     }
  48.     public function setPhone(int $phone): self
  49.     {
  50.         $this->phone $phone;
  51.         return $this;
  52.     }
  53.     public function getCode(): ?string
  54.     {
  55.         return $this->code;
  56.     }
  57.     public function setCode(string $code): self
  58.     {
  59.         $this->code $code;
  60.         return $this;
  61.     }
  62.     public function getName(): ?string
  63.     {
  64.         return $this->name;
  65.     }
  66.     public function setName(string $name): self
  67.     {
  68.         $this->name $name;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection<int, Distributors>
  73.      */
  74.     public function getDistributors(): Collection
  75.     {
  76.         return $this->distributors;
  77.     }
  78.     public function addDistributor(Distributors $distributor): self
  79.     {
  80.         if (!$this->distributors->contains($distributor)) {
  81.             $this->distributors[] = $distributor;
  82.             $distributor->setAddressCountry($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removeDistributor(Distributors $distributor): self
  87.     {
  88.         if ($this->distributors->removeElement($distributor)) {
  89.             // set the owning side to null (unless already changed)
  90.             if ($distributor->getAddressCountry() === $this) {
  91.                 $distributor->setAddressCountry(null);
  92.             }
  93.         }
  94.         return $this;
  95.     }
  96.     public function getModified(): ?\DateTimeInterface
  97.     {
  98.         return $this->modified;
  99.     }
  100.     public function setModified(\DateTimeInterface $modified): self
  101.     {
  102.         $this->modified $modified;
  103.         return $this;
  104.     }
  105.     public function getCreated(): ?\DateTimeInterface
  106.     {
  107.         return $this->created;
  108.     }
  109.     public function setCreated(\DateTimeInterface $created): self
  110.     {
  111.         $this->created $created;
  112.         return $this;
  113.     }
  114.     public function getIsActive(): ?int
  115.     {
  116.         return $this->isActive;
  117.     }
  118.     public function setIsActive(?int $isActive): self
  119.     {
  120.         $this->isActive $isActive;
  121.         return $this;
  122.     }
  123.     /**
  124.      * @return Collection<int, Clinics>
  125.      */
  126.     public function getClinics(): Collection
  127.     {
  128.         return $this->clinics;
  129.     }
  130.     public function addClinic(Clinics $clinic): self
  131.     {
  132.         if (!$this->clinics->contains($clinic)) {
  133.             $this->clinics[] = $clinic;
  134.             $clinic->setCountry($this);
  135.         }
  136.         return $this;
  137.     }
  138.     public function removeClinic(Clinics $clinic): self
  139.     {
  140.         if ($this->clinics->removeElement($clinic)) {
  141.             // set the owning side to null (unless already changed)
  142.             if ($clinic->getCountry() === $this) {
  143.                 $clinic->setCountry(null);
  144.             }
  145.         }
  146.         return $this;
  147.     }
  148.     public function getCurrency(): ?string
  149.     {
  150.         return $this->currency;
  151.     }
  152.     public function setCurrency(?string $currency): self
  153.     {
  154.         $this->currency $currency;
  155.         return $this;
  156.     }
  157.     /**
  158.      * @return Collection<int, RetailUsers>
  159.      */
  160.     public function getRetailUsers(): Collection
  161.     {
  162.         return $this->retailUsers;
  163.     }
  164.     public function addRetailUser(RetailUsers $retailUser): self
  165.     {
  166.         if (!$this->retailUsers->contains($retailUser)) {
  167.             $this->retailUsers[] = $retailUser;
  168.             $retailUser->setCountry($this);
  169.         }
  170.         return $this;
  171.     }
  172.     public function removeRetailUser(RetailUsers $retailUser): self
  173.     {
  174.         if ($this->retailUsers->removeElement($retailUser)) {
  175.             // set the owning side to null (unless already changed)
  176.             if ($retailUser->getCountry() === $this) {
  177.                 $retailUser->setCountry(null);
  178.             }
  179.         }
  180.         return $this;
  181.     }
  182. }