src/Flexy/ShopBundle/Entity/Shipping/ShipmentItemChild.php line 14

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Shipping;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\Flexy\ShopBundle\Entity\Shipping\ShipmentItemChildRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassShipmentItemChildRepository::class)]
  10. #[ApiResource]
  11. class ShipmentItemChild
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255,unique:truenullabletrue)]
  18.     private ?string $barcode null;
  19.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  20.     private ?string $description null;
  21.     #[ORM\ManyToOne(inversedBy'shipmentItemChildren')]
  22.     private ?ShipmentItem $shipmentItem null;
  23.     #[ORM\ManyToMany(targetEntityTrackingStep::class, inversedBy'shipmentItemChildren')]
  24.     private Collection $trackingSteps;
  25.     public function __construct()
  26.     {
  27.         $this->trackingSteps = new ArrayCollection();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getBarcode(): ?string
  34.     {
  35.         return $this->barcode;
  36.     }
  37.     public function setBarcode(string $barcode): self
  38.     {
  39.         $this->barcode $barcode;
  40.         return $this;
  41.     }
  42.     public function getDescription(): ?string
  43.     {
  44.         return $this->description;
  45.     }
  46.     public function setDescription(?string $description): self
  47.     {
  48.         $this->description $description;
  49.         return $this;
  50.     }
  51.     public function getShipmentItem(): ?ShipmentItem
  52.     {
  53.         return $this->shipmentItem;
  54.     }
  55.     public function setShipmentItem(?ShipmentItem $shipmentItem): self
  56.     {
  57.         $this->shipmentItem $shipmentItem;
  58.         return $this;
  59.     }
  60.     /**
  61.      * @return Collection<int, TrackingStep>
  62.      */
  63.     public function getTrackingSteps(): Collection
  64.     {
  65.         return $this->trackingSteps;
  66.     }
  67.     public function addTrackingStep(TrackingStep $trackingStep): self
  68.     {
  69.         if (!$this->trackingSteps->contains($trackingStep)) {
  70.             $this->trackingSteps->add($trackingStep);
  71.         }
  72.         return $this;
  73.     }
  74.     public function removeTrackingStep(TrackingStep $trackingStep): self
  75.     {
  76.         $this->trackingSteps->removeElement($trackingStep);
  77.         return $this;
  78.     }
  79. }