src/Entity/Pays.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PaysRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PaysRepository::class)
  9.  * @ORM\HasLifecycleCallbacks 
  10.  */
  11. class Pays
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $codepays;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $currency;
  31.     /**
  32.      * @ORM\Column(type="float")
  33.      */
  34.     private $coursechange;
  35.     /**
  36.      * @ORM\Column(type="date", nullable=true)
  37.      */
  38.     private $updatedAt;
  39.     /**
  40.      * @ORM\Column(type="float", nullable=true)
  41.      */
  42.     private $tva;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="payslocalisation")
  45.      */
  46.     private $users;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=Ville::class, mappedBy="pays")
  49.      * @ORM\OrderBy({"name" = "ASC"})
  50.      */
  51.     private $villes;
  52.     /**
  53.      * @ORM\OneToMany(targetEntity=Product::class, mappedBy="payslocalisation")
  54.      */
  55.     private $products;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=IctoParamgeneral::class, mappedBy="pays")
  58.      */
  59.     private $ictoParamgenerals;
  60.     public function __construct()
  61.     {
  62.         $this->users = new ArrayCollection();
  63.         $this->villes = new ArrayCollection();
  64.         $this->products = new ArrayCollection();
  65.         $this->ictoParamgenerals = new ArrayCollection();
  66.     }
  67.     public function __toString(){
  68.         return $this->getName();
  69.     }
  70.     /**
  71.      * Undocumented function
  72.      * @ORM\PrePersist
  73.      */
  74.     public function dateUpdateCoursechange()
  75.     {
  76.         $this->updatedAt = new \DateTime();
  77.     }
  78.     public function getId(): ?int
  79.     {
  80.         return $this->id;
  81.     }
  82.     public function getName(): ?string
  83.     {
  84.         return $this->name;
  85.     }
  86.     public function setName(string $name): self
  87.     {
  88.         $this->name $name;
  89.         return $this;
  90.     }
  91.     public function getCodepays(): ?string
  92.     {
  93.         return $this->codepays;
  94.     }
  95.     public function setCodepays(string $codepays): self
  96.     {
  97.         $this->codepays $codepays;
  98.         return $this;
  99.     }
  100.     public function getCurrency(): ?string
  101.     {
  102.         return $this->currency;
  103.     }
  104.     public function setCurrency(string $currency): self
  105.     {
  106.         $this->currency $currency;
  107.         return $this;
  108.     }
  109.     public function getCoursechange(): ?float
  110.     {
  111.         return $this->coursechange;
  112.     }
  113.     /**
  114.      * Undocumented function
  115.      * @param float $coursechange
  116.      * @return self
  117.      */
  118.     public function setCoursechange(float $coursechange): self
  119.     {
  120.         $this->coursechange $coursechange;
  121.         $this->updatedAt = new \DateTime();
  122.         return $this;
  123.     }
  124.     public function getUpdatedAt(): ?\DateTimeInterface
  125.     {
  126.         return $this->updatedAt;
  127.     }
  128.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  129.     {
  130.         $this->updatedAt $updatedAt;
  131.         return $this;
  132.     }
  133.     public function getTva(): ?float
  134.     {
  135.         return $this->tva;
  136.     }
  137.     public function setTva(?float $tva): self
  138.     {
  139.         $this->tva $tva;
  140.         return $this;
  141.     }
  142.     /**
  143.      * @return Collection<int, User>
  144.      */
  145.     public function getUsers(): Collection
  146.     {
  147.         return $this->users;
  148.     }
  149.     public function addUser(User $user): self
  150.     {
  151.         if (!$this->users->contains($user)) {
  152.             $this->users[] = $user;
  153.             $user->setPayslocalisation($this);
  154.         }
  155.         return $this;
  156.     }
  157.     public function removeUser(User $user): self
  158.     {
  159.         if ($this->users->removeElement($user)) {
  160.             // set the owning side to null (unless already changed)
  161.             if ($user->getPayslocalisation() === $this) {
  162.                 $user->setPayslocalisation(null);
  163.             }
  164.         }
  165.         return $this;
  166.     }
  167.     /**
  168.      * @return Collection<int, Ville>
  169.      */
  170.     public function getVilles(): Collection
  171.     {
  172.         return $this->villes;
  173.     }
  174.     public function addVille(Ville $ville): self
  175.     {
  176.         if (!$this->villes->contains($ville)) {
  177.             $this->villes[] = $ville;
  178.             $ville->setPays($this);
  179.         }
  180.         return $this;
  181.     }
  182.     public function removeVille(Ville $ville): self
  183.     {
  184.         if ($this->villes->removeElement($ville)) {
  185.             // set the owning side to null (unless already changed)
  186.             if ($ville->getPays() === $this) {
  187.                 $ville->setPays(null);
  188.             }
  189.         }
  190.         return $this;
  191.     }
  192.     /**
  193.      * @return Collection<int, Product>
  194.      */
  195.     public function getProducts(): Collection
  196.     {
  197.         return $this->products;
  198.     }
  199.     public function addProduct(Product $product): self
  200.     {
  201.         if (!$this->products->contains($product)) {
  202.             $this->products[] = $product;
  203.             $product->setPayslocalisation($this);
  204.         }
  205.         return $this;
  206.     }
  207.     public function removeProduct(Product $product): self
  208.     {
  209.         if ($this->products->removeElement($product)) {
  210.             // set the owning side to null (unless already changed)
  211.             if ($product->getPayslocalisation() === $this) {
  212.                 $product->setPayslocalisation(null);
  213.             }
  214.         }
  215.         return $this;
  216.     }
  217.     /**
  218.      * @return Collection<int, IctoParamgeneral>
  219.      */
  220.     public function getIctoParamgenerals(): Collection
  221.     {
  222.         return $this->ictoParamgenerals;
  223.     }
  224.     public function addIctoParamgeneral(IctoParamgeneral $ictoParamgeneral): self
  225.     {
  226.         if (!$this->ictoParamgenerals->contains($ictoParamgeneral)) {
  227.             $this->ictoParamgenerals[] = $ictoParamgeneral;
  228.             $ictoParamgeneral->setPays($this);
  229.         }
  230.         return $this;
  231.     }
  232.     public function removeIctoParamgeneral(IctoParamgeneral $ictoParamgeneral): self
  233.     {
  234.         if ($this->ictoParamgenerals->removeElement($ictoParamgeneral)) {
  235.             // set the owning side to null (unless already changed)
  236.             if ($ictoParamgeneral->getPays() === $this) {
  237.                 $ictoParamgeneral->setPays(null);
  238.             }
  239.         }
  240.         return $this;
  241.     }
  242. }