src/Flexy/ShopBundle/Entity/Shipping/Shipment.php line 25

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Shipping;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Entity\LogHistory;
  5. use App\Flexy\ShopBundle\Entity\Customer\Customer;
  6. use App\Flexy\ShopBundle\Entity\Store\Store;
  7. use App\Flexy\ShopBundle\Repository\Shipping\ShipmentRepository;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use App\Flexy\ShopBundle\Entity\Order\Order;
  11. use Doctrine\DBAL\Types\Types;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. use Gedmo\Mapping\Annotation as Gedmo;
  15. use Symfony\Component\Serializer\Annotation\Groups;
  16. #[ApiResource(
  17.     normalizationContext: ['groups' => ['read']],
  18.     denormalizationContext: ['groups' => ['write']],
  19. )]
  20. #[ORM\Entity(repositoryClassShipmentRepository::class)]
  21. #[Gedmo\Loggable(logEntryClass:LogHistory::class)]
  22. class Shipment
  23. {
  24.     #[ORM\Id]
  25.     #[ORM\GeneratedValue]
  26.     #[ORM\Column(type'integer')]
  27.     private $id;
  28.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  29.     #[Groups(['read','write'])]
  30.     private ?\DateTimeImmutable $createdAt null;
  31.     #[ORM\Column(type'string'length255nullabletrue)]
  32.     #[Assert\NotNull]
  33.     #[Assert\NotBlank]
  34.     #[Assert\Regex(pattern'/[a-zA-Z0-9,.]/'message'Address must be alphanumeric')]
  35.     #[Groups(['read','write'])]
  36.     private $collectAddress;
  37.         #[ORM\Column(type'string'length255nullabletrue)]
  38.     private $collectAddressIndication;
  39.     #[ORM\Column(type'string'length255nullabletrue)]
  40.     private $collectLng;
  41.         #[ORM\Column(type'string'length255nullabletrue)]
  42.     private $collectLat;
  43.     #[ORM\Column(type'string'length255nullabletrue)]
  44.     private $collectAddressPhone;
  45.     #[ORM\Column(type'string'length255nullabletrue)]
  46.     #[Assert\NotNull]
  47.     #[Assert\NotBlank]
  48.     #[Assert\Regex(pattern'/[a-zA-Z0-9,.]/'message'Address must be alphanumeric')]
  49.     private $shippingAddress;
  50.     #[ORM\Column(type'string'length255nullabletrue)]
  51.     private $shippingAddressIndication;
  52.         #[ORM\Column(type'string'length255nullabletrue)]
  53.     private $shippingLng;
  54.             #[ORM\Column(type'string'length255nullabletrue)]
  55.     private $shippingLat;
  56.     #[ORM\Column(type'string'length255nullabletrue)]
  57.     private $shippingPhone;
  58.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  59.     private ?\DateTimeInterface $collectDate null;
  60.     #[ORM\Column(typeTypes::TIME_MUTABLEnullabletrue)]
  61.     private ?\DateTimeInterface $collectTime null;
  62.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  63.     private ?\DateTimeInterface $shippingDate null;
  64.     #[ORM\Column(typeTypes::TIME_MUTABLEnullabletrue)]
  65.     private ?\DateTimeInterface $shippingTime null;
  66.     #[ORM\Column(type'string'length255nullabletrue)]
  67.     private ?string $state null;
  68.     #[ORM\Column(type'string'length255nullabletrue)]
  69.     private ?string $trackingCode null;
  70.     #[ORM\Column(type'text'nullabletrue)]
  71.     #[Gedmo\Versioned]
  72.     private ?string $description null;
  73.     #[ORM\ManyToOne(targetEntityShippingMethod::class, inversedBy'shippments')]
  74.     private ?\App\Flexy\ShopBundle\Entity\Shipping\ShippingMethod $method null;
  75.     #[ORM\OneToMany(targetEntityShipmentItem::class, mappedBy'shipment'orphanRemovaltrue,cascade:["persist"])]
  76.     #[Assert\Count(
  77.         min1,
  78.         max5,
  79.         minMessage'You must specify at least one shipment item',
  80.         maxMessage'You cannot specify more than {{ limit }} shipment items',
  81.         groups: ['shipment-item-steps-form']
  82.     )]
  83.     
  84.     private \Doctrine\Common\Collections\Collection|array $shipmentItems;
  85.     #[ORM\OneToMany(mappedBy'shipment'targetEntityTrackingStep::class, orphanRemovaltrue,cascade:["persist"])]
  86.     
  87.     private Collection $trackingSteps;
  88.     #[ORM\Column(length255nullabletrue)]
  89.     #[Groups(['read','write'])]
  90.     private ?string $status null;
  91.     #[ORM\ManyToOne]
  92.     private ?City $collectCity null;
  93.     #[ORM\ManyToOne]
  94.     private ?City $shippingCity null;
  95.     #[ORM\Column(length255,unique:true)]
  96.     private ?string $reference null;
  97.     #[ORM\Column(length255)]
  98.     #[Gedmo\Versioned]
  99.     private ?string $paymentType null;
  100.     #[ORM\ManyToOne(inversedBy'sentShipments')]
  101.     #[Gedmo\Versioned]
  102.     private ?Customer $senderCustomer null;
  103.     #[ORM\ManyToOne(inversedBy'receivedShipments')]
  104.     #[Gedmo\Versioned]
  105.     private ?Customer $recipientCustomer null;
  106.     #[ORM\Column(nullabletrue)]
  107.     private ?float $declaredValue null;
  108.     #[ORM\Column(nullabletrue)]
  109.     private ?float $volume null;
  110.     #[ORM\Column(length255nullabletrue)]
  111.     private ?string $shippingLocationType null;
  112.     #[ORM\Column(length255nullabletrue)]
  113.     private ?string $image null;
  114.     #[ORM\OneToMany(mappedBy'shipment'targetEntityCashOnDelivery::class, orphanRemovaltrue,cascade:["persist"])]
  115.     #[Assert\Count(
  116.         min0,
  117.         max3,
  118.         minMessage'You must specify at least one COD',
  119.         maxMessage'You cannot specify more than {{ limit }} COD\'s ',
  120.         groups: ['cod-steps-form']
  121.     )]
  122.     
  123.     private Collection $cashOnDeliveries;
  124.     
  125.     #[ORM\Column(nullabletrue)]
  126.     private ?float $shippingFees null;
  127.     #[ORM\ManyToOne(inversedBy'collectedShipments')]
  128.     private ?Store $collectedByStore null;
  129.     #[ORM\ManyToOne(inversedBy'shippedShipments')]
  130.     private ?Store $shippedByStore null;
  131.     #[ORM\ManyToOne]
  132.     private ?ShippingMethod $shippingMethod null;
  133.     
  134.     #[ORM\OneToMany(mappedBy'shipment'targetEntityShipmentPaper::class,cascade:["persist"])]
  135.     
  136.     private Collection $shipmentPapers;
  137.     
  138.     #[ORM\OneToMany(mappedBy'shipment'targetEntityShipmentCollectMoney::class,cascade:["persist"])]
  139.     #[Assert\Count(
  140.         min1,
  141.         max2,
  142.         minMessage'You must specify at least one Shiment Collect Money',
  143.         maxMessage'You cannot specify more than {{ limit }} Shiment Collect Money',
  144.         groups: ['collect-money-steps-form']
  145.     )]
  146.     private Collection $shipmentCollectMoney;
  147.     #[ORM\Column(nullabletrue)]
  148.     private ?bool $isCODCashCollected null;
  149.     #[ORM\Column(nullabletrue)]
  150.     private ?bool $isShipmentCollectMoneyCollected null;
  151.     #[ORM\Column(nullabletrue)]
  152.     private ?bool $isShipmentReceiptCollected null;
  153.     #[ORM\Column(nullabletrue)]
  154.     private ?bool $isCODCheckOrBillCollected null;
  155.     #[ORM\Column(nullabletrue)]
  156.     private ?bool $isDeliveryReceiptCollected null;
  157.     #[ORM\Column(nullabletrue)]
  158.     private ?bool $isInvoiceCollected null;
  159.     #[ORM\OneToOne(mappedBy'shipment'cascade: ['persist'])]
  160.     private ?Order $relatedOrder null;
  161.     #[ORM\ManyToOne(inversedBy'collectedShipments')]
  162.     private ?CityRegion $collectCityRegion null;
  163.     #[ORM\ManyToOne(inversedBy'shippedShipments')]
  164.     private ?CityRegion $shippingCityRegion null;
  165.     public function __toString()
  166.     {
  167.         return (string)$this->reference;
  168.     }
  169.     public function __construct()
  170.     {
  171.         $this->shipmentItems = new ArrayCollection();
  172.         $this->trackingSteps = new ArrayCollection();
  173.         $this->cashOnDeliveries = new ArrayCollection();
  174.         $this->shipmentPapers = new ArrayCollection();
  175.         $this->shipmentCollectMoney = new ArrayCollection();
  176.         $currentDateTime = new \DateTime();
  177.         $this->collectDate = clone $currentDateTime;
  178.         $this->shippingDate = clone $currentDateTime;
  179.         $currentDateTime->modify($currentDateTime->format("H").":00");
  180.         $currentDateTime->modify("+ 1 hour");
  181.         $this->collectTime $currentDateTime;
  182.         $shippingTime = clone $currentDateTime
  183.         $shippingTime->modify("+ 1 hour");
  184.         $this->shippingTime $shippingTime;
  185.        
  186.     }
  187.     public function getId(): ?int
  188.     {
  189.         return $this->id;
  190.     }
  191.     public function getCreatedAt(): ?\DateTimeImmutable
  192.     {
  193.         return $this->createdAt;
  194.     }
  195.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  196.     {
  197.         $this->createdAt $createdAt;
  198.         return $this;
  199.     }
  200.     public function getState(): ?string
  201.     {
  202.         return $this->state;
  203.     }
  204.     public function setState(string $state): self
  205.     {
  206.         $this->state $state;
  207.         return $this;
  208.     }
  209.     public function getTrackingCode(): ?string
  210.     {
  211.         return $this->trackingCode;
  212.     }
  213.     public function setTrackingCode(?string $trackingCode): self
  214.     {
  215.         $this->trackingCode $trackingCode;
  216.         return $this;
  217.     }
  218.     public function getDescription(): ?string
  219.     {
  220.         return $this->description;
  221.     }
  222.     public function setDescription(?string $description): self
  223.     {
  224.         $this->description $description;
  225.         return $this;
  226.     }
  227.     public function getMethod(): ?ShippingMethod
  228.     {
  229.         return $this->method;
  230.     }
  231.     public function setMethod(?ShippingMethod $method): self
  232.     {
  233.         $this->method $method;
  234.         return $this;
  235.     }
  236.     /**
  237.      * @return Collection|ShipmentItem[]
  238.      */
  239.     public function getShipmentItems(): Collection
  240.     {
  241.         return $this->shipmentItems;
  242.     }
  243.     public function addShipmentItem(ShipmentItem $shipmentItem): self
  244.     {
  245.         if (!$this->shipmentItems->contains($shipmentItem)) {
  246.             $this->shipmentItems[] = $shipmentItem;
  247.             $shipmentItem->setShipment($this);
  248.         }
  249.         return $this;
  250.     }
  251.     public function removeShipmentItem(ShipmentItem $shipmentItem): self
  252.     {
  253.         if ($this->shipmentItems->removeElement($shipmentItem)) {
  254.             // set the owning side to null (unless already changed)
  255.             if ($shipmentItem->getShipment() === $this) {
  256.                 $shipmentItem->setShipment(null);
  257.             }
  258.         }
  259.         return $this;
  260.     }
  261.     /**
  262.      * @return Collection<int, TrackingStep>
  263.      */
  264.     public function getTrackingSteps(): Collection
  265.     {
  266.         return $this->trackingSteps;
  267.     }
  268.     public function addTrackingStep(TrackingStep $shipmentTrackingStep): self
  269.     {
  270.         if (!$this->trackingSteps->contains($shipmentTrackingStep)) {
  271.             $this->trackingSteps->add($shipmentTrackingStep);
  272.             $shipmentTrackingStep->setShipment($this);
  273.         }
  274.         return $this;
  275.     }
  276.     public function removeTrackingStep(TrackingStep $shipmentTrackingStep): self
  277.     {
  278.         if ($this->trackingSteps->removeElement($shipmentTrackingStep)) {
  279.             // set the owning side to null (unless already changed)
  280.             if ($shipmentTrackingStep->getShipment() === $this) {
  281.                 $shipmentTrackingStep->setShipment(null);
  282.             }
  283.         }
  284.         return $this;
  285.     }
  286.     public function getShipmentItemsChildren(){
  287.         $children = [];
  288.         foreach($this->getShipmentItems() as $singleItem){
  289.             foreach($singleItem->getShipmentItemChildren() as $singleChild){
  290.                 $children[]= $singleChild;
  291.             }
  292.         }
  293.         return $children;
  294.     }
  295.     public function getCurrentStepTrackedChildren(){
  296.         $children = [];
  297.         foreach($this->getShipmentItems() as $singleItem){
  298.             foreach($singleItem->getShipmentItemChildren() as $singleChild){
  299.                 if($singleChild->getTrackingSteps()->contains($this->getTrackingSteps()->last()) ){
  300.                     $children[]= $singleChild;
  301.                 }
  302.                 
  303.             }
  304.         }
  305.         return $children;
  306.     }
  307.     public function getAllTrackedChildren(){
  308.         $children = [];
  309.         foreach($this->getShipmentItems() as $singleItem){
  310.             foreach($singleItem->getShipmentItemChildren() as $singleChild){
  311.                 
  312.                     $children[]= $singleChild;
  313.                 
  314.                 
  315.             }
  316.         }
  317.         return $children;
  318.     }
  319.     public function getDirectionHub(){
  320.        $direction "";
  321.        if(count($this->getTrackingSteps()) > 0){
  322.         $direction $this->getTrackingSteps()->last()->getStepType()->getDirectionHub();
  323.        }
  324.         return $direction;
  325.     }
  326.     #[Groups(['read','write'])]
  327.     public function getCurrentStep(){
  328.         $stepType null;
  329.         if(count($this->getTrackingSteps()) > 0){
  330.          $stepType $this->getTrackingSteps()->last()->getStepType();
  331.         }
  332.          return $stepType;
  333.      }
  334.      public function getAllSteps(){
  335.         $allSteps = [];
  336.         foreach($this->getTrackingSteps() as $singleTrackingStep){
  337.             if(!in_array($singleTrackingStep->getStepType(),$allSteps)){
  338.                 $allSteps[] = $singleTrackingStep->getStepType();
  339.             }
  340.             
  341.         }
  342.          return $allSteps;
  343.      }
  344.     public function getStatus(): ?string
  345.     {
  346.         return $this->status;
  347.     }
  348.     public function setStatus(?string $status): self
  349.     {
  350.         $this->status $status;
  351.         return $this;
  352.     }
  353.     public function getCollectCity(): ?City
  354.     {
  355.         return $this->collectCity;
  356.     }
  357.     public function setCollectCity(?City $collectCity): self
  358.     {
  359.         $this->collectCity $collectCity;
  360.         return $this;
  361.     }
  362.     public function getShippingCity(): ?City
  363.     {
  364.         return $this->shippingCity;
  365.     }
  366.     public function setShippingCity(?City $shippingCity): self
  367.     {
  368.         $this->shippingCity $shippingCity;
  369.         return $this;
  370.     }
  371.     public function getReference(): ?string
  372.     {
  373.         return $this->reference;
  374.     }
  375.     public function setReference(string $reference): self
  376.     {
  377.         $this->reference $reference;
  378.         return $this;
  379.     }
  380.     public function getPaymentType(): ?string
  381.     {
  382.         return $this->paymentType;
  383.     }
  384.     public function setPaymentType(string $paymentType): self
  385.     {
  386.         $this->paymentType $paymentType;
  387.         return $this;
  388.     }
  389.     public function getSenderCustomer(): ?Customer
  390.     {
  391.         return $this->senderCustomer;
  392.     }
  393.     public function setSenderCustomer(?Customer $senderCustomer): self
  394.     {
  395.         $this->senderCustomer $senderCustomer;
  396.         return $this;
  397.     }
  398.     public function getRecipientCustomer(): ?Customer
  399.     {
  400.         return $this->recipientCustomer;
  401.     }
  402.     public function setRecipientCustomer(?Customer $recipientCustomer): self
  403.     {
  404.         $this->recipientCustomer $recipientCustomer;
  405.         return $this;
  406.     }
  407.     public function getDeclaredValue(): ?float
  408.     {
  409.         return $this->declaredValue;
  410.     }
  411.     public function setDeclaredValue(?float $declaredValue): self
  412.     {
  413.         $this->declaredValue $declaredValue;
  414.         return $this;
  415.     }
  416.     public function getVolume(): ?float
  417.     {
  418.         return $this->volume;
  419.     }
  420.     public function setVolume(?float $volume): self
  421.     {
  422.         $this->volume $volume;
  423.         return $this;
  424.     }
  425.     public function getShippingLocationType(): ?string
  426.     {
  427.         return $this->shippingLocationType;
  428.     }
  429.     public function setShippingLocationType(?string $shippingLocationType): self
  430.     {
  431.         $this->shippingLocationType $shippingLocationType;
  432.         return $this;
  433.     }
  434.     public function getImage(): ?string
  435.     {
  436.         return $this->image;
  437.     }
  438.     public function setImage(?string $image): self
  439.     {
  440.         $this->image $image;
  441.         return $this;
  442.     }
  443.     /**
  444.      * @return Collection<int, CashOnDelivery>
  445.      */
  446.     public function getCashOnDeliveries(): Collection
  447.     {
  448.         return $this->cashOnDeliveries;
  449.     }
  450.     public function addCashOnDelivery(CashOnDelivery $cashOnDelivery): self
  451.     {
  452.         if (!$this->cashOnDeliveries->contains($cashOnDelivery)) {
  453.             $this->cashOnDeliveries->add($cashOnDelivery);
  454.             $cashOnDelivery->setShipment($this);
  455.         }
  456.         return $this;
  457.     }
  458.     public function removeCashOnDelivery(CashOnDelivery $cashOnDelivery): self
  459.     {
  460.         if ($this->cashOnDeliveries->removeElement($cashOnDelivery)) {
  461.             // set the owning side to null (unless already changed)
  462.             if ($cashOnDelivery->getShipment() === $this) {
  463.                 $cashOnDelivery->setShipment(null);
  464.             }
  465.         }
  466.         return $this;
  467.     }
  468.     public function getShippingFees(): ?float
  469.     {
  470.         return $this->shippingFees;
  471.     }
  472.     public function setShippingFees(?float $shippingFees): self
  473.     {
  474.         $this->shippingFees $shippingFees;
  475.         return $this;
  476.     }
  477.     public function getCollectedByStore(): ?Store
  478.     {
  479.         return $this->collectedByStore;
  480.     }
  481.     public function setCollectedByStore(?Store $collectedByStore): self
  482.     {
  483.         $this->collectedByStore $collectedByStore;
  484.         return $this;
  485.     }
  486.     public function getShippedByStore(): ?Store
  487.     {
  488.         return $this->shippedByStore;
  489.     }
  490.     public function setShippedByStore(?Store $shippedByStore): self
  491.     {
  492.         $this->shippedByStore $shippedByStore;
  493.         return $this;
  494.     }
  495.     public function getShippingMethod(): ?ShippingMethod
  496.     {
  497.         return $this->shippingMethod;
  498.     }
  499.     public function setShippingMethod(?ShippingMethod $shippingMethod): self
  500.     {
  501.         $this->shippingMethod $shippingMethod;
  502.         return $this;
  503.     }
  504.     /**
  505.      * @return Collection<int, ShipmentPaper>
  506.      */
  507.     public function getShipmentPapers(): Collection
  508.     {
  509.         return $this->shipmentPapers;
  510.     }
  511.     public function addShipmentPaper(ShipmentPaper $shipmentPaper): self
  512.     {
  513.         if (!$this->shipmentPapers->contains($shipmentPaper)) {
  514.             $this->shipmentPapers->add($shipmentPaper);
  515.             $shipmentPaper->setShipment($this);
  516.         }
  517.         return $this;
  518.     }
  519.     public function removeShipmentPaper(ShipmentPaper $shipmentPaper): self
  520.     {
  521.         if ($this->shipmentPapers->removeElement($shipmentPaper)) {
  522.             // set the owning side to null (unless already changed)
  523.             if ($shipmentPaper->getShipment() === $this) {
  524.                 $shipmentPaper->setShipment(null);
  525.             }
  526.         }
  527.         return $this;
  528.     }
  529.     /**
  530.      * @return Collection<int, ShipmentCollectMoney>
  531.      */
  532.     public function getShipmentCollectMoney(): Collection
  533.     {
  534.         return $this->shipmentCollectMoney;
  535.     }
  536.     public function addShipmentCollectMoney(ShipmentCollectMoney $shipmentCollectMoney): self
  537.     {
  538.         if (!$this->shipmentCollectMoney->contains($shipmentCollectMoney)) {
  539.             $this->shipmentCollectMoney->add($shipmentCollectMoney);
  540.             $shipmentCollectMoney->setShipment($this);
  541.         }
  542.         return $this;
  543.     }
  544.     public function removeShipmentCollectMoney(ShipmentCollectMoney $shipmentCollectMoney): self
  545.     {
  546.         if ($this->shipmentCollectMoney->removeElement($shipmentCollectMoney)) {
  547.             // set the owning side to null (unless already changed)
  548.             if ($shipmentCollectMoney->getShipment() === $this) {
  549.                 $shipmentCollectMoney->setShipment(null);
  550.             }
  551.         }
  552.         return $this;
  553.     }
  554.     public function isIsCODCashCollected(): ?bool
  555.     {
  556.         return $this->isCODCashCollected;
  557.     }
  558.     public function setIsCODCashCollected(?bool $isCODCashCollected): self
  559.     {
  560.         $this->isCODCashCollected $isCODCashCollected;
  561.         return $this;
  562.     }
  563.     public function isIsShipmentCollectMoneyCollected(): ?bool
  564.     {
  565.         return $this->isShipmentCollectMoneyCollected;
  566.     }
  567.     public function setIsShipmentCollectMoneyCollected(?bool $isShipmentCollectMoneyCollected): self
  568.     {
  569.         $this->isShipmentCollectMoneyCollected $isShipmentCollectMoneyCollected;
  570.         return $this;
  571.     }
  572.     public function isIsShipmentReceiptCollected(): ?bool
  573.     {
  574.         return $this->isShipmentReceiptCollected;
  575.     }
  576.     public function setIsShipmentReceiptCollected(?bool $isShipmentReceiptCollected): self
  577.     {
  578.         $this->isShipmentReceiptCollected $isShipmentReceiptCollected;
  579.         return $this;
  580.     }
  581.     public function isIsCODCheckOrBillCollected(): ?bool
  582.     {
  583.         return $this->isCODCheckOrBillCollected;
  584.     }
  585.     public function setIsCODCheckOrBillCollected(?bool $isCODCheckOrBillCollected): self
  586.     {
  587.         $this->isCODCheckOrBillCollected $isCODCheckOrBillCollected;
  588.         return $this;
  589.     }
  590.     public function isIsDeliveryReceiptCollected(): ?bool
  591.     {
  592.         return $this->isDeliveryReceiptCollected;
  593.     }
  594.     public function setIsDeliveryReceiptCollected(?bool $isDeliveryReceiptCollected): self
  595.     {
  596.         $this->isDeliveryReceiptCollected $isDeliveryReceiptCollected;
  597.         return $this;
  598.     }
  599.     public function isIsInvoiceCollected(): ?bool
  600.     {
  601.         return $this->isInvoiceCollected;
  602.     }
  603.     public function setIsInvoiceCollected(?bool $isInvoiceCollected): self
  604.     {
  605.         $this->isInvoiceCollected $isInvoiceCollected;
  606.         return $this;
  607.     }
  608.     public function getRelatedOrder(): ?Order
  609.     {
  610.         return $this->relatedOrder;
  611.     }
  612.     public function setRelatedOrder(?Order $relatedOrder): self
  613.     {
  614.         // unset the owning side of the relation if necessary
  615.         if ($relatedOrder === null && $this->relatedOrder !== null) {
  616.             $this->relatedOrder->setShipment(null);
  617.         }
  618.         // set the owning side of the relation if necessary
  619.         if ($relatedOrder !== null && $relatedOrder->getShipment() !== $this) {
  620.             $relatedOrder->setShipment($this);
  621.         }
  622.         $this->relatedOrder $relatedOrder;
  623.         return $this;
  624.     }
  625.     public function getCollectCityRegion(): ?CityRegion
  626.     {
  627.         return $this->collectCityRegion;
  628.     }
  629.     public function setCollectCityRegion(?CityRegion $collectCityRegion): self
  630.     {
  631.         $this->collectCityRegion $collectCityRegion;
  632.         return $this;
  633.     }
  634.     public function getShippingCityRegion(): ?CityRegion
  635.     {
  636.         return $this->shippingCityRegion;
  637.     }
  638.     public function setShippingCityRegion(?CityRegion $shippingCityRegion): self
  639.     {
  640.         $this->shippingCityRegion $shippingCityRegion;
  641.         return $this;
  642.     }
  643.     public function getCollectAddress(): ?string
  644.     {
  645.         return $this->collectAddress;
  646.     }
  647.     public function getFullCollectAddress(): ?string
  648.     {
  649.         return $this->collectAddress.", ".$this->getCollectCityRegion();
  650.     }
  651.     public function setCollectAddress(?string $collectAddress): self
  652.     {
  653.         $this->collectAddress $collectAddress;
  654.         return $this;
  655.     }
  656.     public function getCollectAddressIndication(): ?string
  657.     {
  658.         return $this->collectAddressIndication;
  659.     }
  660.     public function setCollectAddressIndication(?string $collectAddressIndication): self
  661.     {
  662.         $this->collectAddressIndication $collectAddressIndication;
  663.         return $this;
  664.     }
  665.     public function getCollectLng(): ?string
  666.     {
  667.         return $this->collectLng;
  668.     }
  669.     public function setCollectLng(?string $collectLng): self
  670.     {
  671.         $this->collectLng $collectLng;
  672.         return $this;
  673.     }
  674.     public function getCollectLat(): ?string
  675.     {
  676.         return $this->collectLat;
  677.     }
  678.     public function setCollectLat(?string $collectLat): self
  679.     {
  680.         $this->collectLat $collectLat;
  681.         return $this;
  682.     }
  683.     public function getCollectAddressPhone(): ?string
  684.     {
  685.         return $this->collectAddressPhone;
  686.     }
  687.     public function setCollectAddressPhone(?string $collectAddressPhone): self
  688.     {
  689.         $this->collectAddressPhone $collectAddressPhone;
  690.         return $this;
  691.     }
  692.     public function getShippingAddress(): ?string
  693.     {
  694.         return $this->shippingAddress;
  695.     }
  696.     public function getFullShippingAddress(): ?string
  697.     {
  698.         return $this->shippingAddress.", ".$this->getShippingCityRegion();
  699.     }
  700.     public function setShippingAddress(?string $shippingAddress): self
  701.     {
  702.         $this->shippingAddress $shippingAddress;
  703.         return $this;
  704.     }
  705.     public function getShippingAddressIndication(): ?string
  706.     {
  707.         return $this->shippingAddressIndication;
  708.     }
  709.     public function setShippingAddressIndication(?string $shippingAddressIndication): self
  710.     {
  711.         $this->shippingAddressIndication $shippingAddressIndication;
  712.         return $this;
  713.     }
  714.     public function getShippingLng(): ?string
  715.     {
  716.         return $this->shippingLng;
  717.     }
  718.     public function setShippingLng(?string $shippingLng): self
  719.     {
  720.         $this->shippingLng $shippingLng;
  721.         return $this;
  722.     }
  723.     public function getShippingLat(): ?string
  724.     {
  725.         return $this->shippingLat;
  726.     }
  727.     public function setShippingLat(?string $shippingLat): self
  728.     {
  729.         $this->shippingLat $shippingLat;
  730.         return $this;
  731.     }
  732.     public function getShippingPhone(): ?string
  733.     {
  734.         return $this->shippingPhone;
  735.     }
  736.     public function setShippingPhone(?string $shippingPhone): self
  737.     {
  738.         $this->shippingPhone $shippingPhone;
  739.         return $this;
  740.     }
  741.     
  742.     /**
  743.      * Get the value of shippingTime
  744.      */ 
  745.     public function getShippingTime()
  746.     {
  747.         return $this->shippingTime;
  748.     }
  749.     /**
  750.      * Set the value of shippingTime
  751.      *
  752.      * @return  self
  753.      */ 
  754.     public function setShippingTime($shippingTime)
  755.     {
  756.         $this->shippingTime $shippingTime;
  757.         return $this;
  758.     }
  759.     /**
  760.      * Get the value of shippingDate
  761.      */ 
  762.     public function getShippingDate()
  763.     {
  764.         return $this->shippingDate;
  765.     }
  766.     /**
  767.      * Set the value of shippingDate
  768.      *
  769.      * @return  self
  770.      */ 
  771.     public function setShippingDate($shippingDate)
  772.     {
  773.         $this->shippingDate $shippingDate;
  774.         return $this;
  775.     }
  776.     /**
  777.      * Get the value of collectTime
  778.      */ 
  779.     public function getCollectTime()
  780.     {
  781.         return $this->collectTime;
  782.     }
  783.     /**
  784.      * Set the value of collectTime
  785.      *
  786.      * @return  self
  787.      */ 
  788.     public function setCollectTime($collectTime)
  789.     {
  790.         $this->collectTime $collectTime;
  791.         return $this;
  792.     }
  793.     /**
  794.      * Get the value of collectDate
  795.      */ 
  796.     public function getCollectDate()
  797.     {
  798.         return $this->collectDate;
  799.     }
  800.     /**
  801.      * Set the value of collectDate
  802.      *
  803.      * @return  self
  804.      */ 
  805.     public function setCollectDate($collectDate)
  806.     {
  807.         $this->collectDate $collectDate;
  808.         return $this;
  809.     }
  810. }