src/Entity/Olympiad/Online/Participant/Result.php line 15

  1. <?php
  2. namespace App\Entity\Olympiad\Online\Participant;
  3. use App\Entity\Common\File;
  4. use App\Entity\Olympiad\Online\Participant;
  5. use App\Entity\Traits\CreatedTrait;
  6. use App\Entity\Traits\UpdatedTrait;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Table(name'olymp_online_participant_result')]
  10. #[ORM\Entity(repositoryClass'App\Repository\Olympiad\Online\ResultRepository')]
  11. #[ORM\HasLifecycleCallbacks]
  12. class Result
  13. {
  14.     use CreatedTrait;
  15.     use UpdatedTrait;
  16.     #[ORM\OneToOne(targetEntity\App\Entity\Olympiad\Online\Participant::class)]
  17.     #[ORM\Id]
  18.     private Participant $participant;
  19.     #[ORM\Column(type'float'nullabletrue)]
  20.     private ?float $score;
  21.     #[ORM\Column(type'boolean'options: ['default' => false])]
  22.     private bool $disqualified false;
  23.     #[ORM\Column(type'string'nullabletrue)]
  24.     private ?string $disqualified_reason null;
  25.     #[ORM\Column(type'boolean')]
  26.     private bool $moodle_result false;
  27.     #[ORM\Column(typeTypes::JSONnullabletrue)]
  28.     private ?array $detailed=null;
  29.     /**
  30.      * @var File|null
  31.      */
  32.     #[ORM\ManyToOne(targetEntity'App\Entity\Common\File')]
  33.     private ?File $certificate null;
  34.     /**
  35.      * @return Participant
  36.      */
  37.     public function getParticipant(): Participant
  38.     {
  39.         return $this->participant;
  40.     }
  41.     /**
  42.      * @param Participant $participant
  43.      */
  44.     public function setParticipant(Participant $participant): void
  45.     {
  46.         $this->participant $participant;
  47.     }
  48.     /**
  49.      * @return float
  50.      */
  51.     public function getScore(): float
  52.     {
  53.         return $this->score;
  54.     }
  55.     /**
  56.      * @param float $score
  57.      */
  58.     public function setScore(float $score): void
  59.     {
  60.         $this->score $score;
  61.     }
  62.     /**
  63.      * @return bool
  64.      */
  65.     public function isDisqualified(): bool
  66.     {
  67.         return $this->disqualified;
  68.     }
  69.     /**
  70.      * @param bool $disqualified
  71.      */
  72.     public function setDisqualified(bool $disqualified): void
  73.     {
  74.         $this->disqualified $disqualified;
  75.     }
  76.     /**
  77.      * @return string|null
  78.      */
  79.     public function getDisqualifiedReason(): ?string
  80.     {
  81.         return $this->disqualified_reason;
  82.     }
  83.     /**
  84.      * @param string|null $disqualified_reason
  85.      */
  86.     public function setDisqualifiedReason(?string $disqualified_reason): void
  87.     {
  88.         $this->disqualified_reason $disqualified_reason;
  89.     }
  90.     /**
  91.      * @return File|null
  92.      */
  93.     public function getCertificate(): ?File
  94.     {
  95.         return $this->certificate;
  96.     }
  97.     /**
  98.      * @param File|null $certificate
  99.      */
  100.     public function setCertificate(?File $certificate): void
  101.     {
  102.         $this->certificate $certificate;
  103.     }
  104.     /**
  105.      * @return bool
  106.      */
  107.     public function isMoodleResult(): bool
  108.     {
  109.         return $this->moodle_result;
  110.     }
  111.     /**
  112.      * @param bool $moodle_result
  113.      */
  114.     public function setMoodleResult(bool $moodle_result): void
  115.     {
  116.         $this->moodle_result $moodle_result;
  117.     }
  118.     public function getDetailed(): ?array
  119.     {
  120.         return $this->detailed;
  121.     }
  122.     public function setDetailed(?array $detailed): void
  123.     {
  124.         $this->detailed $detailed;
  125.     }
  126. }