src/Entity/Incoterm.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\IncotermRepository")
  8.  */
  9. class Incoterm
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="datetime", nullable=true)
  23.      */
  24.     private $created_at;
  25.     /**
  26.      * @ORM\OneToMany(targetEntity="App\Entity\Appariement", mappedBy="base")
  27.      */
  28.     private $appariements;
  29.     /**
  30.      * @ORM\OneToMany(targetEntity="App\Entity\AdminDonneurOrdre", mappedBy="base")
  31.      */
  32.     private $adminDonneurOrdres;
  33.     /**
  34.      * @ORM\OneToMany(targetEntity="App\Entity\AppelDeMarge", mappedBy="base")
  35.      */
  36.     private $appelDeMarges;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity="App\Entity\Operation", mappedBy="base")
  39.      */
  40.     private $operations;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity="App\Entity\Quotation", mappedBy="incoterm")
  43.      */
  44.     private $quotaions;
  45.     /**
  46.      * @ORM\Column(type="text", nullable=true)
  47.      */
  48.     private $description;
  49.     public function __construct(){
  50.         $this->created_at = new \DateTime('now');
  51.         $this->appariements = new ArrayCollection();
  52.         $this->adminDonneurOrdres = new ArrayCollection();
  53.         $this->appelDeMarges = new ArrayCollection();
  54.         $this->operations = new ArrayCollection();
  55.         $this->quotaions = new ArrayCollection();
  56.     }
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getName(): ?string
  62.     {
  63.         return $this->name;
  64.     }
  65.     public function setName(string $name): self
  66.     {
  67.         $this->name $name;
  68.         return $this;
  69.     }
  70.     public function getCreatedAt(): ?\DateTimeInterface
  71.     {
  72.         return $this->created_at;
  73.     }
  74.     public function setCreatedAt(\DateTimeInterface $created_at): self
  75.     {
  76.         $this->created_at $created_at;
  77.         return $this;
  78.     }
  79.     /**
  80.      * @return Collection|Appariement[]
  81.      */
  82.     public function getAppariements(): Collection
  83.     {
  84.         return $this->appariements;
  85.     }
  86.     public function addAppariement(Appariement $appariement): self
  87.     {
  88.         if (!$this->appariements->contains($appariement)) {
  89.             $this->appariements[] = $appariement;
  90.             $appariement->setBase($this);
  91.         }
  92.         return $this;
  93.     }
  94.     public function removeAppariement(Appariement $appariement): self
  95.     {
  96.         if ($this->appariements->contains($appariement)) {
  97.             $this->appariements->removeElement($appariement);
  98.             // set the owning side to null (unless already changed)
  99.             if ($appariement->getBase() === $this) {
  100.                 $appariement->setBase(null);
  101.             }
  102.         }
  103.         return $this;
  104.     }
  105.     /**
  106.      * @return Collection|Quotation[]
  107.      */
  108.     public function getQuotations(): Collection {
  109.         return $this->quotaions;
  110.     }
  111.     public function addQuotation(Quotation $quotation): self{
  112.         if (!$this->quotaions->contains($quotation)) {
  113.             $this->quotaions[] = $quotation;
  114.             $quotation->setIncoterm($this);
  115.         }
  116.         return $this;
  117.     }
  118.     public function removeQuotation(Quotation $quotation): self{
  119.         if ($this->quotaions->contains($quotation)) {
  120.             $this->quotaions->removeElement($quotation);
  121.             // set the owning side to null (unless already changed)
  122.             if ($quotation->getIncoterm() === $this) {
  123.                 $quotation->setIncoterm(null);
  124.             }
  125.         }
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection|AdminDonneurOrdre[]
  130.      */
  131.     public function getAdminDonneurOrdres(): Collection
  132.     {
  133.         return $this->adminDonneurOrdres;
  134.     }
  135.     public function addAdminDonneurOrdre(AdminDonneurOrdre $adminDonneurOrdre): self
  136.     {
  137.         if (!$this->adminDonneurOrdres->contains($adminDonneurOrdre)) {
  138.             $this->adminDonneurOrdres[] = $adminDonneurOrdre;
  139.             $adminDonneurOrdre->setBase($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeAdminDonneurOrdre(AdminDonneurOrdre $adminDonneurOrdre): self
  144.     {
  145.         if ($this->adminDonneurOrdres->contains($adminDonneurOrdre)) {
  146.             $this->adminDonneurOrdres->removeElement($adminDonneurOrdre);
  147.             // set the owning side to null (unless already changed)
  148.             if ($adminDonneurOrdre->getBase() === $this) {
  149.                 $adminDonneurOrdre->setBase(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154.     public function __toString(): string
  155.     {
  156.         return $this->name;
  157.     }
  158.     /**
  159.      * @return Collection|AppelDeMarge[]
  160.      */
  161.     public function getAppelDeMarges(): Collection
  162.     {
  163.         return $this->appelDeMarges;
  164.     }
  165.     public function addAppelDeMarge(AppelDeMarge $appelDeMarge): self
  166.     {
  167.         if (!$this->appelDeMarges->contains($appelDeMarge)) {
  168.             $this->appelDeMarges[] = $appelDeMarge;
  169.             $appelDeMarge->setBase($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removeAppelDeMarge(AppelDeMarge $appelDeMarge): self
  174.     {
  175.         if ($this->appelDeMarges->contains($appelDeMarge)) {
  176.             $this->appelDeMarges->removeElement($appelDeMarge);
  177.             // set the owning side to null (unless already changed)
  178.             if ($appelDeMarge->getBase() === $this) {
  179.                 $appelDeMarge->setBase(null);
  180.             }
  181.         }
  182.         return $this;
  183.     }
  184.     /**
  185.      * @return Collection|Operation[]
  186.      */
  187.     public function getOperations(): Collection
  188.     {
  189.         return $this->operations;
  190.     }
  191.     public function addOperation(Operation $operation): self
  192.     {
  193.         if (!$this->operations->contains($operation)) {
  194.             $this->operations[] = $operation;
  195.             $operation->setBase($this);
  196.         }
  197.         return $this;
  198.     }
  199.     public function removeOperation(Operation $operation): self
  200.     {
  201.         if ($this->operations->contains($operation)) {
  202.             $this->operations->removeElement($operation);
  203.             // set the owning side to null (unless already changed)
  204.             if ($operation->getBase() === $this) {
  205.                 $operation->setBase(null);
  206.             }
  207.         }
  208.         return $this;
  209.     }
  210.     public function getDescription(): ?string
  211.     {
  212.         return $this->description;
  213.     }
  214.     public function setDescription(?string $description): self
  215.     {
  216.         $this->description $description;
  217.         return $this;
  218.     }
  219. }