src/Entity/Shipping.php line 22

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