src/Entity/Shipping.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Dispatch\Dispatch;
  4. use App\Entity\Documentation\Document;
  5. use App\Entity\Documentation\HouseGuide;
  6. use App\Entity\Documentation\ShippingCargoManifest;
  7. use App\Entity\Documentation\ShippingPackingList;
  8. use App\Entity\Expedient\Log;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. /**
  13.  * Shipping
  14.  *
  15.  * @ORM\Table(name="shipping", indexes={@ORM\Index(name="FKshipping550656", columns={"person_sending_id"}), @ORM\Index(name="FKshipping830015", columns={"person_receiving_id"})})
  16.  * @ORM\Entity()
  17.  */
  18. class Shipping
  19. {
  20.     /**
  21.      * @var int
  22.      *
  23.      * @ORM\Column(name="id", type="integer", nullable=false)
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="IDENTITY")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @var string
  30.      *
  31.      * @ORM\Column(name="shipping_mode", type="string", length=255, nullable=false)
  32.      */
  33.     private $shippingMode;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(name="deliveryType", type="string", length=255, nullable=false)
  38.      */
  39.     private $deliveryType;
  40.     /**
  41.      * @var \PersonSending
  42.      *
  43.      * @ORM\ManyToOne(targetEntity="PersonSending")
  44.      * @ORM\JoinColumns({
  45.      *   @ORM\JoinColumn(name="person_sending_id", referencedColumnName="id")
  46.      * })
  47.      */
  48.     private $personSending;
  49.     /**
  50.      * @var \PersonReceiving
  51.      *
  52.      * @ORM\ManyToOne(targetEntity="PersonReceiving")
  53.      * @ORM\JoinColumns({
  54.      *   @ORM\JoinColumn(name="person_receiving_id", referencedColumnName="id")
  55.      * })
  56.      */
  57.     private $personReceiving;
  58.     /**
  59.      * @ORM\ManyToMany(targetEntity=Box::class, inversedBy="shipping", cascade={"remove"})
  60.      */
  61.     private $box;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private $label;
  66.     /**
  67.      * @ORM\Column(type="datetime_immutable", options={"default"="CURRENT_TIMESTAMP"})
  68.      */
  69.     private $createAt;
  70.     /**
  71.      * @ORM\OneToMany(targetEntity=HouseGuide::class, mappedBy="shipping")
  72.      */
  73.     private $houseGuides;
  74.     /**
  75.      * @ORM\ManyToOne(targetEntity=BusinessClient::class, inversedBy="shippings")
  76.      */
  77.     private $businessClient;
  78.     /**
  79.      * @ORM\Column(type="float")
  80.      */
  81.     private $price;
  82.     /**
  83.      * @ORM\Column(type="float")
  84.      */
  85.     private $priceByKG;
  86.     /**
  87.      * @ORM\OneToMany(targetEntity=ShippingCurrency::class, mappedBy="shipping", cascade={"remove"})
  88.      */
  89.     private $currencies;
  90.     /**
  91.      * @ORM\OneToMany(targetEntity=Log::class, mappedBy="shipping", cascade={"remove"})
  92.      */
  93.     private $logs;
  94.     /**
  95.      * @ORM\ManyToOne(targetEntity=Dispatch::class, inversedBy="shippings")
  96.      */
  97.     private $dispatch;
  98.     /**
  99.      * @ORM\OneToMany(targetEntity=Document::class, mappedBy="shipping")
  100.      */
  101.     private $documents;
  102.     /**
  103.      * @ORM\OneToMany(targetEntity=ShippingCargoManifest::class, mappedBy="shipping")
  104.      */
  105.     private $shippingCargoManifests;
  106.     /**
  107.      * @ORM\OneToMany(targetEntity=ShippingPackingList::class, mappedBy="shipping")
  108.      */
  109.     private $shippingPackingLists;
  110.     /**
  111.      * @ORM\ManyToOne(targetEntity=AppUser::class, inversedBy="shippings")
  112.      * @ORM\JoinColumn(nullable=false)
  113.      */
  114.     private $createdBy;
  115.     public function __construct()
  116.     {
  117.         $this->box = new ArrayCollection();
  118.         $this->houseGuides = new ArrayCollection();
  119.         $this->currencies = new ArrayCollection();
  120.         $this->logs = new ArrayCollection();
  121.         $this->documents = new ArrayCollection();
  122.         $this->shippingCargoManifests = new ArrayCollection();
  123.         $this->shippingPackingLists = new ArrayCollection();
  124.     }
  125.     public function getId(): ?int
  126.     {
  127.         return $this->id;
  128.     }
  129.     public function getPersonSending(): ?PersonSending
  130.     {
  131.         return $this->personSending;
  132.     }
  133.     public function setPersonSending(?PersonSending $personSending): self
  134.     {
  135.         $this->personSending $personSending;
  136.         return $this;
  137.     }
  138.     public function getPersonReceiving(): ?PersonReceiving
  139.     {
  140.         return $this->personReceiving;
  141.     }
  142.     public function setPersonReceiving(?PersonReceiving $personReceiving): self
  143.     {
  144.         $this->personReceiving $personReceiving;
  145.         return $this;
  146.     }
  147.     public function getDeliveryType(): ?string
  148.     {
  149.         return $this->deliveryType;
  150.     }
  151.     public function setDeliveryType(string $deliveryType): self
  152.     {
  153.         $this->deliveryType $deliveryType;
  154.         return $this;
  155.     }
  156.     public function getShippingMode(): ?string
  157.     {
  158.         return $this->shippingMode;
  159.     }
  160.     public function setShippingMode(string $shippingMode): self
  161.     {
  162.         $this->shippingMode $shippingMode;
  163.         return $this;
  164.     }
  165.     /**
  166.      * @return Collection<int, Box>
  167.      */
  168.     public function getBox(): Collection
  169.     {
  170.         return $this->box;
  171.     }
  172.     public function addBox(Box $box): self
  173.     {
  174.         if (!$this->box->contains($box)) {
  175.             $this->box[] = $box;
  176.         }
  177.         return $this;
  178.     }
  179.     public function removeBox(Box $box): self
  180.     {
  181.         $this->box->removeElement($box);
  182.         return $this;
  183.     }
  184.     public function getLabel(): ?string
  185.     {
  186.         return $this->label;
  187.     }
  188.     public function setLabel(string $label): self
  189.     {
  190.         $this->label $label;
  191.         return $this;
  192.     }
  193.     public function getCreateAt(): ?\DateTimeImmutable
  194.     {
  195.         return $this->createAt;
  196.     }
  197.     public function setCreateAt(\DateTimeImmutable $createAt): self
  198.     {
  199.         $this->createAt $createAt;
  200.         return $this;
  201.     }
  202.     /**
  203.      * @return Collection<int, HouseGuide>
  204.      */
  205.     public function getHouseGuides(): Collection
  206.     {
  207.         return $this->houseGuides;
  208.     }
  209.     public function addHouseGuide(HouseGuide $houseGuide): self
  210.     {
  211.         if (!$this->houseGuides->contains($houseGuide)) {
  212.             $this->houseGuides[] = $houseGuide;
  213.             $houseGuide->setShipping($this);
  214.         }
  215.         return $this;
  216.     }
  217.     public function removeHouseGuide(HouseGuide $houseGuide): self
  218.     {
  219.         if ($this->houseGuides->removeElement($houseGuide)) {
  220.             // set the owning side to null (unless already changed)
  221.             if ($houseGuide->getShipping() === $this) {
  222.                 $houseGuide->setShipping(null);
  223.             }
  224.         }
  225.         return $this;
  226.     }
  227.     public function getBusinessClient(): ?BusinessClient
  228.     {
  229.         return $this->businessClient;
  230.     }
  231.     public function setBusinessClient(?BusinessClient $businessClient): self
  232.     {
  233.         $this->businessClient $businessClient;
  234.         return $this;
  235.     }
  236.     public function getPrice(): ?float
  237.     {
  238.         return $this->price;
  239.     }
  240.     public function setPrice(float $price): self
  241.     {
  242.         $this->price $price;
  243.         return $this;
  244.     }
  245.     public function getPriceByKG(): ?float
  246.     {
  247.         return $this->priceByKG;
  248.     }
  249.     public function setPriceByKG(float $priceByKG): self
  250.     {
  251.         $this->priceByKG $priceByKG;
  252.         return $this;
  253.     }
  254.     /**
  255.      * @return Collection<int, ShippingCurrency>
  256.      */
  257.     public function getCurrencies(): Collection
  258.     {
  259.         return $this->currencies;
  260.     }
  261.     public function addCurrency(ShippingCurrency $currency): self
  262.     {
  263.         if (!$this->currencies->contains($currency)) {
  264.             $this->currencies[] = $currency;
  265.             $currency->setShipping($this);
  266.         }
  267.         return $this;
  268.     }
  269.     public function removeCurrency(ShippingCurrency $currency): self
  270.     {
  271.         if ($this->currencies->removeElement($currency)) {
  272.             // set the owning side to null (unless already changed)
  273.             if ($currency->getShipping() === $this) {
  274.                 $currency->setShipping(null);
  275.             }
  276.         }
  277.         return $this;
  278.     }
  279.     /**
  280.      * @return Collection<int, Log>
  281.      */
  282.     public function getLogs(): Collection
  283.     {
  284.         return $this->logs;
  285.     }
  286.     public function addLog(Log $log): self
  287.     {
  288.         if (!$this->logs->contains($log)) {
  289.             $this->logs[] = $log;
  290.             $log->setShipping($this);
  291.         }
  292.         return $this;
  293.     }
  294.     public function removeLog(Log $log): self
  295.     {
  296.         if ($this->logs->removeElement($log)) {
  297.             // set the owning side to null (unless already changed)
  298.             if ($log->getShipping() === $this) {
  299.                 $log->setShipping(null);
  300.             }
  301.         }
  302.         return $this;
  303.     }
  304.     public function getDispatch(): ?Dispatch
  305.     {
  306.         return $this->dispatch;
  307.     }
  308.     public function setDispatch(?Dispatch $dispatch): self
  309.     {
  310.         $this->dispatch $dispatch;
  311.         return $this;
  312.     }
  313.     /**
  314.      * @return Collection<int, Document>
  315.      */
  316.     public function getDocuments(): Collection
  317.     {
  318.         return $this->documents;
  319.     }
  320.     public function addDocument(Document $document): self
  321.     {
  322.         if (!$this->documents->contains($document)) {
  323.             $this->documents[] = $document;
  324.             $document->setShipping($this);
  325.         }
  326.         return $this;
  327.     }
  328.     public function removeDocument(Document $document): self
  329.     {
  330.         if ($this->documents->removeElement($document)) {
  331.             // set the owning side to null (unless already changed)
  332.             if ($document->getShipping() === $this) {
  333.                 $document->setShipping(null);
  334.             }
  335.         }
  336.         return $this;
  337.     }
  338.     /**
  339.      * @return Collection<int, ShippingCargoManifest>
  340.      */
  341.     public function getShippingCargoManifests(): Collection
  342.     {
  343.         return $this->shippingCargoManifests;
  344.     }
  345.     public function addShippingCargoManifest(ShippingCargoManifest $shippingCargoManifest): self
  346.     {
  347.         if (!$this->shippingCargoManifests->contains($shippingCargoManifest)) {
  348.             $this->shippingCargoManifests[] = $shippingCargoManifest;
  349.             $shippingCargoManifest->setShipping($this);
  350.         }
  351.         return $this;
  352.     }
  353.     public function removeShippingCargoManifest(ShippingCargoManifest $shippingCargoManifest): self
  354.     {
  355.         if ($this->shippingCargoManifests->removeElement($shippingCargoManifest)) {
  356.             // set the owning side to null (unless already changed)
  357.             if ($shippingCargoManifest->getShipping() === $this) {
  358.                 $shippingCargoManifest->setShipping(null);
  359.             }
  360.         }
  361.         return $this;
  362.     }
  363.     /**
  364.      * @return Collection<int, ShippingPackingList>
  365.      */
  366.     public function getShippingPackingLists(): Collection
  367.     {
  368.         return $this->shippingPackingLists;
  369.     }
  370.     public function addShippingPackingList(ShippingPackingList $shippingPackingList): self
  371.     {
  372.         if (!$this->shippingPackingLists->contains($shippingPackingList)) {
  373.             $this->shippingPackingLists[] = $shippingPackingList;
  374.             $shippingPackingList->setShipping($this);
  375.         }
  376.         return $this;
  377.     }
  378.     public function removeShippingPackingList(ShippingPackingList $shippingPackingList): self
  379.     {
  380.         if ($this->shippingPackingLists->removeElement($shippingPackingList)) {
  381.             // set the owning side to null (unless already changed)
  382.             if ($shippingPackingList->getShipping() === $this) {
  383.                 $shippingPackingList->setShipping(null);
  384.             }
  385.         }
  386.         return $this;
  387.     }
  388.     public function __toString()
  389.     {
  390.         return $this->label;
  391.     }
  392.     public function getCreatedBy(): ?AppUser
  393.     {
  394.         return $this->createdBy;
  395.     }
  396.     public function setCreatedBy(?AppUser $createdBy): self
  397.     {
  398.         $this->createdBy $createdBy;
  399.         return $this;
  400.     }
  401. }