src/Entity/Olympiad/Online/Participant/Message.php line 14

  1. <?php
  2. namespace App\Entity\Olympiad\Online\Participant;
  3. use App\Entity\Olympiad\Online\Participant;
  4. use App\Entity\Traits\CreatedTrait;
  5. use App\Entity\Traits\DeletedTrait;
  6. use App\Entity\Traits\UpdatedTrait;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Table(name'olymp_online_participant_message')]
  9. #[ORM\Entity(repositoryClass'App\Repository\Olympiad\Online\MessageRepository')]
  10. #[ORM\HasLifecycleCallbacks]
  11. class Message
  12. {
  13.     use CreatedTrait;
  14.     use UpdatedTrait;
  15.     use DeletedTrait;
  16.     public const TYPE_RESULT_WINNER 'result_winner';
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue(strategy'AUTO')]
  19.     #[ORM\Column(type'integer')]
  20.     private ?int $id;
  21.     #[ORM\ManyToOne(targetEntity'App\Entity\Olympiad\Online\Participant')]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private Participant $participant;
  24.     #[ORM\Column(type'string')]
  25.     private string $type self::TYPE_RESULT_WINNER;
  26.     #[ORM\Column(type'boolean')]
  27.     private bool $show true;
  28.     #[ORM\Column(type'text'nullabletrue)]
  29.     private ?string $message null;
  30.     /**
  31.      * @return int|null
  32.      */
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     /**
  38.      * @param int|null $id
  39.      */
  40.     public function setId(?int $id): void
  41.     {
  42.         $this->id $id;
  43.     }
  44.     /**
  45.      * @return Participant
  46.      */
  47.     public function getParticipant(): Participant
  48.     {
  49.         return $this->participant;
  50.     }
  51.     /**
  52.      * @param Participant $participant
  53.      */
  54.     public function setParticipant(Participant $participant): void
  55.     {
  56.         $this->participant $participant;
  57.     }
  58.     /**
  59.      * @return string
  60.      */
  61.     public function getType(): string
  62.     {
  63.         return $this->type;
  64.     }
  65.     /**
  66.      * @param string $type
  67.      */
  68.     public function setType(string $type): void
  69.     {
  70.         $this->type $type;
  71.     }
  72.     /**
  73.      * @return bool
  74.      */
  75.     public function isShow(): bool
  76.     {
  77.         return $this->show;
  78.     }
  79.     /**
  80.      * @param bool $show
  81.      */
  82.     public function setShow(bool $show): void
  83.     {
  84.         $this->show $show;
  85.     }
  86.     /**
  87.      * @return string|null
  88.      */
  89.     public function getMessage(): ?string
  90.     {
  91.         return $this->message;
  92.     }
  93.     /**
  94.      * @param string|null $message
  95.      */
  96.     public function setMessage(?string $message): void
  97.     {
  98.         $this->message $message;
  99.     }
  100. }