<?php
namespace App\Entity;
use App\Repository\CancellationParametersRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=CancellationParametersRepository::class)
*/
class CancellationParameters
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToOne(targetEntity=Event::class, inversedBy="cancellationParameters", cascade={"persist", "remove"})
*/
private $event;
/** Params for Registration_Cancellation **/
/**
* Between limitA and limitB we will be unable to cancel a registration
* @var int Hours before the start of the event
* @ORM\Column(type="integer", nullable=true)
*/
private $limitA = 0;
/**
* Between limitB and limitC it will cost amountN to cancel the registration
* @var int Hours before the start of the event
* @ORM\Column(type="integer", nullable=true)
* @Assert\GreaterThan(propertyPath="limitA")
*/
private $limitB;
/**
* Between limitC and limitD it will cost amountM to cancel the registration
* @var int Hours before the start of the event
* @ORM\Column(type="integer", nullable=true)
* @Assert\GreaterThan(propertyPath="limitB")
*/
private $limitC;
/**
* After limitD it will be free to cancel the registration
* @var int Hours before the start of the event
* @ORM\Column(type="integer", nullable=true)
* @Assert\GreaterThan(propertyPath="limitC")
*/
private $limitD;
/**
* @var float Amount in % of the price for the client
* @ORM\Column(type="float", nullable=true)
* @Assert\LessThan(propertyPath="event.price")
*/
private $amountN;
/**
* @var float Amount in % of the price for the client
* @ORM\Column(type="float", nullable=true)
* @Assert\LessThan(propertyPath="event.price")
*/
private $amountM;
/** Params for Event_Cancellation **/
/**
* @ORM\Column(type="integer", nullable=true, options={"default": 48})
*/
private $limitHours = 0;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $limitDate;
/**
* @ORM\Column(type="integer", nullable=true, options={"default": 0})
*/
private $minCapacity = 0;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": 1})
*/
private $isAutoCancel = 1;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $limitDateReminder;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $limitDateReminderAdmin;
public function __construct()
{
$this->isAutoCancel = 0;
}
public function getId(): ?int
{
return $this->id;
}
public function getEvent(): ?Event
{
return $this->event;
}
public function setEvent(?Event $event): self
{
$this->event = $event;
return $this;
}
public function getLimitA(): ?int
{
return $this->limitA;
}
public function setLimitA(int $limitA): self
{
$this->limitA = $limitA;
return $this;
}
public function getLimitB(): ?int
{
return $this->limitB;
}
public function setLimitB(?int $limitB): self
{
$this->limitB = $limitB;
return $this;
}
public function getLimitC(): ?int
{
return $this->limitC;
}
public function setLimitC(?int $limitC): self
{
$this->limitC = $limitC;
return $this;
}
public function getLimitD(): ?int
{
return $this->limitD;
}
public function setLimitD(?int $limitD): self
{
$this->limitD = $limitD;
return $this;
}
public function getAmountN(): ?float
{
return $this->amountN;
}
public function setAmountN(?float $amountN): self
{
$this->amountN = $amountN;
return $this;
}
public function getAmountM(): ?float
{
return $this->amountM;
}
public function setAmountM(?float $amountM): self
{
$this->amountM = $amountM;
return $this;
}
public function getLimitHours(): ?int
{
return $this->limitHours;
}
public function setLimitHours(?int $limitHours): self
{
$this->limitHours = $limitHours;
return $this;
}
public function getLimitDate(): ?\DateTimeInterface
{
return $this->limitDate;
}
public function setLimitDate(?\DateTimeInterface $limitDate): self
{
$this->limitDate = $limitDate;
return $this;
}
public function getMinCapacity(): ?int
{
return $this->minCapacity;
}
public function setMinCapacity(?int $minCapacity): self
{
$this->minCapacity = $minCapacity;
return $this;
}
public function getIsAutoCancel(): ?bool
{
return $this->isAutoCancel;
}
public function setIsAutoCancel(?bool $isAutoCancel): self
{
$this->isAutoCancel = $isAutoCancel;
return $this;
}
public function getLimitDateReminder(): ?\DateTimeInterface
{
return $this->limitDateReminder;
}
public function setLimitDateReminder(?\DateTimeInterface $limitDateReminder): self
{
$this->limitDateReminder = $limitDateReminder;
return $this;
}
public function getLimitDateReminderAdmin(): ?\DateTimeInterface
{
return $this->limitDateReminderAdmin;
}
public function setLimitDateReminderAdmin(?\DateTimeInterface $limitDateReminderAdmin): self
{
$this->limitDateReminderAdmin = $limitDateReminderAdmin;
return $this;
}
}