src/Entity/CancellationParameters.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CancellationParametersRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass=CancellationParametersRepository::class)
  8.  */
  9. class CancellationParameters
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\OneToOne(targetEntity=Event::class, inversedBy="cancellationParameters", cascade={"persist", "remove"})
  19.      */
  20.     private $event;
  21.     /** Params for Registration_Cancellation **/
  22.     /**
  23.      * Between limitA and limitB we will be unable to cancel a registration
  24.      * @var int Hours before the start of the event
  25.      * @ORM\Column(type="integer", nullable=true)
  26.      */
  27.     private $limitA 0;
  28.     /**
  29.      * Between limitB and limitC it will cost amountN to cancel the registration
  30.      * @var int Hours before the start of the event
  31.      * @ORM\Column(type="integer", nullable=true)
  32.      * @Assert\GreaterThan(propertyPath="limitA")
  33.      */
  34.     private $limitB;
  35.     /**
  36.      * Between limitC and limitD it will cost amountM to cancel the registration
  37.      * @var int Hours before the start of the event
  38.      * @ORM\Column(type="integer", nullable=true)
  39.      * @Assert\GreaterThan(propertyPath="limitB")
  40.      */
  41.     private $limitC;
  42.     /**
  43.      * After limitD it will be free to cancel the registration
  44.      * @var int Hours before the start of the event
  45.      * @ORM\Column(type="integer", nullable=true)
  46.      * @Assert\GreaterThan(propertyPath="limitC")
  47.      */
  48.     private $limitD;
  49.     /**
  50.      * @var float Amount in % of the price for the client
  51.      * @ORM\Column(type="float", nullable=true)
  52.      * @Assert\LessThan(propertyPath="event.price")
  53.      */
  54.     private $amountN;
  55.     /**
  56.      * @var float Amount in % of the price for the client
  57.      * @ORM\Column(type="float", nullable=true)
  58.      * @Assert\LessThan(propertyPath="event.price")
  59.      */
  60.     private $amountM;
  61.     /** Params for Event_Cancellation **/
  62.     /**
  63.      * @ORM\Column(type="integer", nullable=true, options={"default": 48})
  64.      */
  65.     private $limitHours 0;
  66.     /**
  67.      * @ORM\Column(type="datetime", nullable=true)
  68.      */
  69.     private $limitDate;
  70.     /**
  71.      * @ORM\Column(type="integer", nullable=true, options={"default": 0})
  72.      */
  73.     private $minCapacity 0;
  74.     /**
  75.      * @ORM\Column(type="boolean", nullable=true, options={"default": 1})
  76.      */
  77.     private $isAutoCancel 1;
  78.     /**
  79.      * @ORM\Column(type="datetime", nullable=true)
  80.      */
  81.     private $limitDateReminder;
  82.     /**
  83.      * @ORM\Column(type="datetime", nullable=true)
  84.      */
  85.     private $limitDateReminderAdmin;
  86.     
  87.     public function __construct()
  88.     {
  89.         $this->isAutoCancel 0;
  90.     }
  91.     public function getId(): ?int
  92.     {
  93.         return $this->id;
  94.     }
  95.     public function getEvent(): ?Event
  96.     {
  97.         return $this->event;
  98.     }
  99.     public function setEvent(?Event $event): self
  100.     {
  101.         $this->event $event;
  102.         return $this;
  103.     }
  104.     public function getLimitA(): ?int
  105.     {
  106.         return $this->limitA;
  107.     }
  108.     public function setLimitA(int $limitA): self
  109.     {
  110.         $this->limitA $limitA;
  111.         return $this;
  112.     }
  113.     public function getLimitB(): ?int
  114.     {
  115.         return $this->limitB;
  116.     }
  117.     public function setLimitB(?int $limitB): self
  118.     {
  119.         $this->limitB $limitB;
  120.         return $this;
  121.     }
  122.     public function getLimitC(): ?int
  123.     {
  124.         return $this->limitC;
  125.     }
  126.     public function setLimitC(?int $limitC): self
  127.     {
  128.         $this->limitC $limitC;
  129.         return $this;
  130.     }
  131.     public function getLimitD(): ?int
  132.     {
  133.         return $this->limitD;
  134.     }
  135.     public function setLimitD(?int $limitD): self
  136.     {
  137.         $this->limitD $limitD;
  138.         return $this;
  139.     }
  140.     public function getAmountN(): ?float
  141.     {
  142.         return $this->amountN;
  143.     }
  144.     public function setAmountN(?float $amountN): self
  145.     {
  146.         $this->amountN $amountN;
  147.         return $this;
  148.     }
  149.     public function getAmountM(): ?float
  150.     {
  151.         return $this->amountM;
  152.     }
  153.     public function setAmountM(?float $amountM): self
  154.     {
  155.         $this->amountM $amountM;
  156.         return $this;
  157.     }
  158.     public function getLimitHours(): ?int
  159.     {
  160.         return $this->limitHours;
  161.     }
  162.     public function setLimitHours(?int $limitHours): self
  163.     {
  164.         $this->limitHours $limitHours;
  165.         return $this;
  166.     }
  167.     
  168.     public function getLimitDate(): ?\DateTimeInterface
  169.     {
  170.         return $this->limitDate;
  171.     }
  172.     public function setLimitDate(?\DateTimeInterface $limitDate): self
  173.     {
  174.         $this->limitDate $limitDate;
  175.         return $this;
  176.     }
  177.     public function getMinCapacity(): ?int
  178.     {
  179.         return $this->minCapacity;
  180.     }
  181.     public function setMinCapacity(?int $minCapacity): self
  182.     {
  183.         $this->minCapacity $minCapacity;
  184.         return $this;
  185.     }
  186.     public function getIsAutoCancel(): ?bool
  187.     {
  188.         return $this->isAutoCancel;
  189.     }
  190.     public function setIsAutoCancel(?bool $isAutoCancel): self
  191.     {
  192.         $this->isAutoCancel $isAutoCancel;
  193.         return $this;
  194.     }
  195.     public function getLimitDateReminder(): ?\DateTimeInterface
  196.     {
  197.         return $this->limitDateReminder;
  198.     }
  199.     public function setLimitDateReminder(?\DateTimeInterface $limitDateReminder): self
  200.     {
  201.         $this->limitDateReminder $limitDateReminder;
  202.         return $this;
  203.     }
  204.     public function getLimitDateReminderAdmin(): ?\DateTimeInterface
  205.     {
  206.         return $this->limitDateReminderAdmin;
  207.     }
  208.     public function setLimitDateReminderAdmin(?\DateTimeInterface $limitDateReminderAdmin): self
  209.     {
  210.         $this->limitDateReminderAdmin $limitDateReminderAdmin;
  211.         return $this;
  212.     }
  213. }