src/Entity/MarkupRule.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MarkupRuleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Timestampable\Traits\TimestampableEntity;
  6. #[ORM\InheritanceType('JOINED')]
  7. #[ORM\DiscriminatorColumn(name"dtype"type"string")]
  8. #[ORM\DiscriminatorMap(
  9.     [
  10.         'basic' => MarkupBasic::class,
  11.         'price' => MarkupPrice::class,
  12.         'seat' => MarkupSeat::class,
  13.         'fareClass' => MarkupFareClass::class,
  14.         'airline' => MarkupAirline::class,
  15.     ])]
  16. #[ORM\Entity(repositoryClassMarkupRuleRepository::class)]
  17. class MarkupRule
  18. {
  19.     use TimestampableEntity;
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue]
  22.     #[ORM\Column(type'integer')]
  23.     private ?int $id null;
  24.     #[ORM\Column]
  25.     private ?float $value;
  26.     #[ORM\Column]
  27.     private ?int $type;
  28.     #[ORM\ManyToOne(inversedBy'rules')]
  29.     private ?MarkupStrategy $markupStrategy null;
  30.     #[ORM\Column(type'integer'nullabletrueoptions: ['default' => 0])]
  31.     private ?int $priority 0;
  32.     public function __construct()
  33.     {
  34.         $this->value 0;
  35.         $this->type 0;
  36.     }
  37.     public function getPriority(): ?int
  38.     {
  39.         return $this->priority;
  40.     }
  41.     public function setPriority(?int $priority): static
  42.     {
  43.         $this->priority $priority;
  44.         return $this;
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getValue(): ?float
  51.     {
  52.         return $this->value;
  53.     }
  54.     public function setValue(?float $value): self
  55.     {
  56.         $this->value $value;
  57.         return $this;
  58.     }
  59.     public function getType(): ?int
  60.     {
  61.         return $this->type;
  62.     }
  63.     public function setType(?int $type): self
  64.     {
  65.         $this->type $type;
  66.         return $this;
  67.     }
  68.     public function getMarkupStrategy(): ?MarkupStrategy
  69.     {
  70.         return $this->markupStrategy;
  71.     }
  72.     public function setMarkupStrategy(?MarkupStrategy $markupStrategy): static
  73.     {
  74.         $this->markupStrategy $markupStrategy;
  75.         return $this;
  76.     }
  77.     public function __toString(): string
  78.     {
  79.         return $this->name ?? ' ';
  80.     }
  81.     public function getClass()  : string {
  82.         return "MarkupRule";
  83.     }
  84. }