src/Entity/Offer.php line 12
<?php
namespace App\Entity;
use App\Repository\OfferRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OfferRepository::class)]
class Offer
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $created = null;
#[ORM\Column(length: 255)]
private ?string $number = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $formattedNumber = null;
#[ORM\Column(length: 255)]
private ?string $folderPath = null;
#[ORM\OneToMany(mappedBy: 'offer', targetEntity: Orders::class)]
private Collection $orders;
public function __construct()
{
$this->orders = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(?\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function getNumber(): ?string
{
return $this->number;
}
public function setNumber(string $number): self
{
$this->number = $number;
return $this;
}
public function getFormattedNumber(): ?string
{
return $this->formattedNumber;
}
public function setFormattedNumber(?string $formattedNumber): self
{
$this->formattedNumber = $formattedNumber;
return $this;
}
public function getFolderPath(): ?string
{
return $this->folderPath;
}
public function setFolderPath(string $folderPath): self
{
$this->folderPath = $folderPath;
return $this;
}
/**
* @return Collection<int, Orders>
*/
public function getOrders(): Collection
{
return $this->orders;
}
public function addOrder(Orders $order): self
{
if (!$this->orders->contains($order)) {
$this->orders->add($order);
$order->setOffer($this);
}
return $this;
}
public function removeOrder(Orders $order): self
{
if ($this->orders->removeElement($order)) {
// set the owning side to null (unless already changed)
if ($order->getOffer() === $this) {
$order->setOffer(null);
}
}
return $this;
}
}