src/Entity/Offer.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OfferRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassOfferRepository::class)]
  9. class Offer
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  16.     private ?\DateTimeInterface $created null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $number null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $formattedNumber null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $folderPath null;
  23.     #[ORM\OneToMany(mappedBy'offer'targetEntityOrders::class)]
  24.     private Collection $orders;
  25.     public function __construct()
  26.     {
  27.         $this->orders = new ArrayCollection();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getCreated(): ?\DateTimeInterface
  34.     {
  35.         return $this->created;
  36.     }
  37.     public function setCreated(?\DateTimeInterface $created): self
  38.     {
  39.         $this->created $created;
  40.         return $this;
  41.     }
  42.     public function getNumber(): ?string
  43.     {
  44.         return $this->number;
  45.     }
  46.     public function setNumber(string $number): self
  47.     {
  48.         $this->number $number;
  49.         return $this;
  50.     }
  51.     public function getFormattedNumber(): ?string
  52.     {
  53.         return $this->formattedNumber;
  54.     }
  55.     public function setFormattedNumber(?string $formattedNumber): self
  56.     {
  57.         $this->formattedNumber $formattedNumber;
  58.         return $this;
  59.     }
  60.     public function getFolderPath(): ?string
  61.     {
  62.         return $this->folderPath;
  63.     }
  64.     public function setFolderPath(string $folderPath): self
  65.     {
  66.         $this->folderPath $folderPath;
  67.         return $this;
  68.     }
  69.     /**
  70.      * @return Collection<int, Orders>
  71.      */
  72.     public function getOrders(): Collection
  73.     {
  74.         return $this->orders;
  75.     }
  76.     public function addOrder(Orders $order): self
  77.     {
  78.         if (!$this->orders->contains($order)) {
  79.             $this->orders->add($order);
  80.             $order->setOffer($this);
  81.         }
  82.         return $this;
  83.     }
  84.     public function removeOrder(Orders $order): self
  85.     {
  86.         if ($this->orders->removeElement($order)) {
  87.             // set the owning side to null (unless already changed)
  88.             if ($order->getOffer() === $this) {
  89.                 $order->setOffer(null);
  90.             }
  91.         }
  92.         return $this;
  93.     }
  94. }