<?php
namespace App\Entity;
use App\Entity\Dispatch\Dispatch;
use App\Entity\Documentation\Document;
use App\Entity\Documentation\HouseGuide;
use App\Entity\Documentation\ShippingCargoManifest;
use App\Entity\Documentation\ShippingPackingList;
use App\Entity\Expedient\Log;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* Shipping
*
* @ORM\Table(name="shipping", indexes={@ORM\Index(name="FKshipping550656", columns={"person_sending_id"}), @ORM\Index(name="FKshipping830015", columns={"person_receiving_id"})})
* @ORM\Entity()
*/
class Shipping
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="shipping_mode", type="string", length=255, nullable=false)
*/
private $shippingMode;
/**
* @var string
*
* @ORM\Column(name="deliveryType", type="string", length=255, nullable=false)
*/
private $deliveryType;
/**
* @var \PersonSending
*
* @ORM\ManyToOne(targetEntity="PersonSending")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="person_sending_id", referencedColumnName="id")
* })
*/
private $personSending;
/**
* @var \PersonReceiving
*
* @ORM\ManyToOne(targetEntity="PersonReceiving")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="person_receiving_id", referencedColumnName="id")
* })
*/
private $personReceiving;
/**
* @ORM\ManyToMany(targetEntity=Box::class, inversedBy="shipping", cascade={"remove"})
*/
private $box;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $label;
/**
* @ORM\Column(type="datetime_immutable", options={"default"="CURRENT_TIMESTAMP"})
*/
private $createAt;
/**
* @ORM\OneToMany(targetEntity=HouseGuide::class, mappedBy="shipping")
*/
private $houseGuides;
/**
* @ORM\ManyToOne(targetEntity=BusinessClient::class, inversedBy="shippings")
*/
private $businessClient;
/**
* @ORM\Column(type="float")
*/
private $price;
/**
* @ORM\Column(type="float")
*/
private $priceByKG;
/**
* @ORM\OneToMany(targetEntity=ShippingCurrency::class, mappedBy="shipping", cascade={"remove"})
*/
private $currencies;
/**
* @ORM\OneToMany(targetEntity=Log::class, mappedBy="shipping", cascade={"remove"})
*/
private $logs;
/**
* @ORM\ManyToOne(targetEntity=Dispatch::class, inversedBy="shippings")
*/
private $dispatch;
/**
* @ORM\OneToMany(targetEntity=Document::class, mappedBy="shipping")
*/
private $documents;
/**
* @ORM\OneToMany(targetEntity=ShippingCargoManifest::class, mappedBy="shipping")
*/
private $shippingCargoManifests;
/**
* @ORM\OneToMany(targetEntity=ShippingPackingList::class, mappedBy="shipping")
*/
private $shippingPackingLists;
/**
* @ORM\ManyToOne(targetEntity=AppUser::class, inversedBy="shippings")
* @ORM\JoinColumn(nullable=false)
*/
private $createdBy;
public function __construct()
{
$this->box = new ArrayCollection();
$this->houseGuides = new ArrayCollection();
$this->currencies = new ArrayCollection();
$this->logs = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->shippingCargoManifests = new ArrayCollection();
$this->shippingPackingLists = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPersonSending(): ?PersonSending
{
return $this->personSending;
}
public function setPersonSending(?PersonSending $personSending): self
{
$this->personSending = $personSending;
return $this;
}
public function getPersonReceiving(): ?PersonReceiving
{
return $this->personReceiving;
}
public function setPersonReceiving(?PersonReceiving $personReceiving): self
{
$this->personReceiving = $personReceiving;
return $this;
}
public function getDeliveryType(): ?string
{
return $this->deliveryType;
}
public function setDeliveryType(string $deliveryType): self
{
$this->deliveryType = $deliveryType;
return $this;
}
public function getShippingMode(): ?string
{
return $this->shippingMode;
}
public function setShippingMode(string $shippingMode): self
{
$this->shippingMode = $shippingMode;
return $this;
}
/**
* @return Collection<int, Box>
*/
public function getBox(): Collection
{
return $this->box;
}
public function addBox(Box $box): self
{
if (!$this->box->contains($box)) {
$this->box[] = $box;
}
return $this;
}
public function removeBox(Box $box): self
{
$this->box->removeElement($box);
return $this;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getCreateAt(): ?\DateTimeImmutable
{
return $this->createAt;
}
public function setCreateAt(\DateTimeImmutable $createAt): self
{
$this->createAt = $createAt;
return $this;
}
/**
* @return Collection<int, HouseGuide>
*/
public function getHouseGuides(): Collection
{
return $this->houseGuides;
}
public function addHouseGuide(HouseGuide $houseGuide): self
{
if (!$this->houseGuides->contains($houseGuide)) {
$this->houseGuides[] = $houseGuide;
$houseGuide->setShipping($this);
}
return $this;
}
public function removeHouseGuide(HouseGuide $houseGuide): self
{
if ($this->houseGuides->removeElement($houseGuide)) {
// set the owning side to null (unless already changed)
if ($houseGuide->getShipping() === $this) {
$houseGuide->setShipping(null);
}
}
return $this;
}
public function getBusinessClient(): ?BusinessClient
{
return $this->businessClient;
}
public function setBusinessClient(?BusinessClient $businessClient): self
{
$this->businessClient = $businessClient;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(float $price): self
{
$this->price = $price;
return $this;
}
public function getPriceByKG(): ?float
{
return $this->priceByKG;
}
public function setPriceByKG(float $priceByKG): self
{
$this->priceByKG = $priceByKG;
return $this;
}
/**
* @return Collection<int, ShippingCurrency>
*/
public function getCurrencies(): Collection
{
return $this->currencies;
}
public function addCurrency(ShippingCurrency $currency): self
{
if (!$this->currencies->contains($currency)) {
$this->currencies[] = $currency;
$currency->setShipping($this);
}
return $this;
}
public function removeCurrency(ShippingCurrency $currency): self
{
if ($this->currencies->removeElement($currency)) {
// set the owning side to null (unless already changed)
if ($currency->getShipping() === $this) {
$currency->setShipping(null);
}
}
return $this;
}
/**
* @return Collection<int, Log>
*/
public function getLogs(): Collection
{
return $this->logs;
}
public function addLog(Log $log): self
{
if (!$this->logs->contains($log)) {
$this->logs[] = $log;
$log->setShipping($this);
}
return $this;
}
public function removeLog(Log $log): self
{
if ($this->logs->removeElement($log)) {
// set the owning side to null (unless already changed)
if ($log->getShipping() === $this) {
$log->setShipping(null);
}
}
return $this;
}
public function getDispatch(): ?Dispatch
{
return $this->dispatch;
}
public function setDispatch(?Dispatch $dispatch): self
{
$this->dispatch = $dispatch;
return $this;
}
/**
* @return Collection<int, Document>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Document $document): self
{
if (!$this->documents->contains($document)) {
$this->documents[] = $document;
$document->setShipping($this);
}
return $this;
}
public function removeDocument(Document $document): self
{
if ($this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getShipping() === $this) {
$document->setShipping(null);
}
}
return $this;
}
/**
* @return Collection<int, ShippingCargoManifest>
*/
public function getShippingCargoManifests(): Collection
{
return $this->shippingCargoManifests;
}
public function addShippingCargoManifest(ShippingCargoManifest $shippingCargoManifest): self
{
if (!$this->shippingCargoManifests->contains($shippingCargoManifest)) {
$this->shippingCargoManifests[] = $shippingCargoManifest;
$shippingCargoManifest->setShipping($this);
}
return $this;
}
public function removeShippingCargoManifest(ShippingCargoManifest $shippingCargoManifest): self
{
if ($this->shippingCargoManifests->removeElement($shippingCargoManifest)) {
// set the owning side to null (unless already changed)
if ($shippingCargoManifest->getShipping() === $this) {
$shippingCargoManifest->setShipping(null);
}
}
return $this;
}
/**
* @return Collection<int, ShippingPackingList>
*/
public function getShippingPackingLists(): Collection
{
return $this->shippingPackingLists;
}
public function addShippingPackingList(ShippingPackingList $shippingPackingList): self
{
if (!$this->shippingPackingLists->contains($shippingPackingList)) {
$this->shippingPackingLists[] = $shippingPackingList;
$shippingPackingList->setShipping($this);
}
return $this;
}
public function removeShippingPackingList(ShippingPackingList $shippingPackingList): self
{
if ($this->shippingPackingLists->removeElement($shippingPackingList)) {
// set the owning side to null (unless already changed)
if ($shippingPackingList->getShipping() === $this) {
$shippingPackingList->setShipping(null);
}
}
return $this;
}
public function __toString()
{
return $this->label;
}
public function getCreatedBy(): ?AppUser
{
return $this->createdBy;
}
public function setCreatedBy(?AppUser $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
}