src/Flexy/ShopBundle/Entity/Customer/PackEngagement.php line 12
<?php
namespace App\Flexy\ShopBundle\Entity\Customer;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Flexy\ShopBundle\Entity\Order\OrderItem;
use App\Flexy\ShopBundle\Repository\Customer\PackEngagementRepository;
use Doctrine\ORM\Mapping as ORM;
#[ApiResource]
#[ORM\Entity(repositoryClass: PackEngagementRepository::class)]
class PackEngagement
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Pack::class, inversedBy: 'packEngagements', cascade: ['persist'])]
private ?\App\Flexy\ShopBundle\Entity\Customer\Pack $pack = null;
#[ORM\ManyToOne(targetEntity: Customer::class, inversedBy: 'packEngagements')]
private ?\App\Flexy\ShopBundle\Entity\Customer\Customer $customer = null;
#[ORM\Column(type: 'datetime')]
private ?\DateTimeInterface $startAt = null;
#[ORM\Column(type: 'datetime')]
private ?\DateTimeInterface $endAt = null;
#[ORM\OneToOne(targetEntity: OrderItem::class, mappedBy: 'packEngagement', cascade: ['persist', 'remove'])]
private ?\App\Flexy\ShopBundle\Entity\Order\OrderItem $orderItem = null;
public function getId(): ?int
{
return $this->id;
}
public function getPack(): ?Pack
{
return $this->pack;
}
public function setPack(?Pack $pack): self
{
$this->pack = $pack;
return $this;
}
public function getCustomer(): ?Customer
{
return $this->customer;
}
public function setCustomer(?Customer $customer): self
{
$this->customer = $customer;
return $this;
}
public function getStartAt(): ?\DateTimeInterface
{
return $this->startAt;
}
public function setStartAt(\DateTimeInterface $startAt): self
{
$this->startAt = $startAt;
return $this;
}
public function getEndAt(): ?\DateTimeInterface
{
return $this->endAt;
}
public function setEndAt(\DateTimeInterface $endAt): self
{
$this->endAt = $endAt;
return $this;
}
public function getOrderItem(): ?OrderItem
{
return $this->orderItem;
}
public function setOrderItem(?OrderItem $orderItem): self
{
// unset the owning side of the relation if necessary
if ($orderItem === null && $this->orderItem !== null) {
$this->orderItem->setPackEngagement(null);
}
// set the owning side of the relation if necessary
if ($orderItem !== null && $orderItem->getPackEngagement() !== $this) {
$orderItem->setPackEngagement($this);
}
$this->orderItem = $orderItem;
return $this;
}
}