src/Entity/Team.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TeamRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. #[ORM\Entity(repositoryClassTeamRepository::class)]
  11. #[Vich\Uploadable]
  12. class Team
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(typeTypes::TEXT)]
  19.     private ?string $internal_description null;
  20.     #[ORM\ManyToMany(targetEntityJury::class, mappedBy'team')]
  21.     private Collection $juries;
  22.     #[ORM\Column]
  23.     private ?bool $enabled null;
  24.     #[ORM\Column(length255)]
  25.     private ?string $name null;
  26.     #[ORM\Column(length255)]
  27.     private ?string $name_en null;
  28.     #[ORM\OneToMany(mappedBy'team'targetEntityResult::class, orphanRemovaltrue)]
  29.     private Collection $results;
  30.     #[ORM\OneToMany(mappedBy'team'targetEntityComment::class, orphanRemovaltrue)]
  31.     private Collection $comments;
  32.     #[ORM\Column]
  33.     private ?float $file_rating null;
  34.     #[ORM\Column(length255)]
  35.     private ?string $pizza_name '';
  36.     private ?bool $isCompletelyRated null;
  37.     #[Vich\UploadableField(mapping'candidates'fileNameProperty'docName'size'docSize')]
  38.     private ?File $document null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $docName null;
  41.     #[ORM\Column(nullabletrue)]
  42.     private ?int $docSize null;
  43.     #[ORM\Column(nullabletrue)]
  44.     private ?\DateTimeImmutable $docUpdatedAt null;
  45.     #[Vich\UploadableField(mapping'candidates'fileNameProperty'docNameEn'size'docSizeEn')]
  46.     private ?File $documentEn null;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $docNameEn null;
  49.     #[ORM\Column(nullabletrue)]
  50.     private ?int $docSizeEn null;
  51.     #[ORM\Column(nullabletrue)]
  52.     private ?\DateTimeImmutable $docUpdatedAtEn null;
  53.     public function getFileRating(): ?float
  54.     {
  55.         return $this->file_rating;
  56.     }
  57.     public function setFileRating(float $file_rating): self
  58.     {
  59.         $this->file_rating $file_rating;
  60.         return $this;
  61.     }
  62.     public function __construct()
  63.     {
  64.         $this->juries = new ArrayCollection();
  65.         $this->results = new ArrayCollection();
  66.         $this->comments = new ArrayCollection();
  67.     }
  68.     public function getId(): ?int
  69.     {
  70.         return $this->id;
  71.     }
  72.     public function getInternalDescription(): ?string
  73.     {
  74.         return $this->internal_description;
  75.     }
  76.     public function setInternalDescription(string $internal_description): self
  77.     {
  78.         $this->internal_description $internal_description;
  79.         return $this;
  80.     }
  81.     /**
  82.      * @return Collection<int, Jury>
  83.      */
  84.     public function getJuries(): Collection
  85.     {
  86.         return $this->juries;
  87.     }
  88.     public function addJury(Jury $jury): self
  89.     {
  90.         if (!$this->juries->contains($jury)) {
  91.             $this->juries->add($jury);
  92.             $jury->addTeam($this);
  93.         }
  94.         return $this;
  95.     }
  96.     public function removeJury(Jury $jury): self
  97.     {
  98.         if ($this->juries->removeElement($jury)) {
  99.             $jury->removeTeam($this);
  100.         }
  101.         return $this;
  102.     }
  103.     public function isEnabled(): ?bool
  104.     {
  105.         return $this->enabled;
  106.     }
  107.     public function setEnabled(bool $enabled): self
  108.     {
  109.         $this->enabled $enabled;
  110.         return $this;
  111.     }
  112.     public function getName(): ?string
  113.     {
  114.         return $this->name;
  115.     }
  116.     public function setName(string $name): self
  117.     {
  118.         $this->name $name;
  119.         return $this;
  120.     }
  121.     public function getNameEn(): ?string
  122.     {
  123.         return $this->name_en;
  124.     }
  125.     public function setNameEn(string $name_en): self
  126.     {
  127.         $this->name_en $name_en;
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Collection<int, Result>
  132.      */
  133.     public function getResults(): Collection
  134.     {
  135.         return $this->results;
  136.     }
  137.     public function addResult(Result $result): self
  138.     {
  139.         if (!$this->results->contains($result)) {
  140.             $this->results->add($result);
  141.             $result->setTeam($this);
  142.         }
  143.         return $this;
  144.     }
  145.     public function removeResult(Result $result): self
  146.     {
  147.         if ($this->results->removeElement($result)) {
  148.             // set the owning side to null (unless already changed)
  149.             if ($result->getTeam() === $this) {
  150.                 $result->setTeam(null);
  151.             }
  152.         }
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection<int, Comment>
  157.      */
  158.     public function getComments(): Collection
  159.     {
  160.         return $this->comments;
  161.     }
  162.     public function addComment(Comment $comment): self
  163.     {
  164.         if (!$this->comments->contains($comment)) {
  165.             $this->comments->add($comment);
  166.             $comment->setTeam($this);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeComment(Comment $comment): self
  171.     {
  172.         if ($this->comments->removeElement($comment)) {
  173.             // set the owning side to null (unless already changed)
  174.             if ($comment->getTeam() === $this) {
  175.                 $comment->setTeam(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180.     public function isCompletelyRated(): ?bool
  181.     {
  182.         return $this->isCompletelyRated;
  183.     }
  184.     public function setCompletelyRated(bool $isCompletelyRated): self
  185.     {
  186.         $this->isCompletelyRated $isCompletelyRated;
  187.         return $this;
  188.     }
  189.     public function getPizzaName(): ?string
  190.     {
  191.         return $this->pizza_name;
  192.     }
  193.     public function setPizzaName(string $pizza_name): self
  194.     {
  195.         $this->pizza_name $pizza_name;
  196.         return $this;
  197.     }
  198.     public function setDocument(?File $document null): void
  199.     {
  200.         $this->document $document;
  201.         if (null !== $document) {
  202.             // It is required that at least one field changes if you are using doctrine
  203.             // otherwise the event listeners won't be called and the file is lost
  204.             $this->docUpdatedAt = new \DateTimeImmutable();
  205.         }
  206.     }
  207.     public function getDocument(): ?File
  208.     {
  209.         return $this->document;
  210.     }
  211.     public function getDocName(): ?string
  212.     {
  213.         return $this->docName;
  214.     }
  215.     public function setDocName(?string $docName): static
  216.     {
  217.         $this->docName $docName;
  218.         return $this;
  219.     }
  220.     public function getDocSize(): ?int
  221.     {
  222.         return $this->docSize;
  223.     }
  224.     public function setDocSize(?int $docSize): static
  225.     {
  226.         $this->docSize $docSize;
  227.         return $this;
  228.     }
  229.     public function getDocUpdatedAt(): ?\DateTimeImmutable
  230.     {
  231.         return $this->docUpdatedAt;
  232.     }
  233.     public function setDocUpdatedAt(?\DateTimeImmutable $docUpdatedAt): static
  234.     {
  235.         $this->docUpdatedAt $docUpdatedAt;
  236.         return $this;
  237.     }
  238.     public function setDocumentEn(?File $documentEn null): void
  239.     {
  240.         $this->documentEn $documentEn;
  241.         if (null !== $documentEn) {
  242.             // It is required that at least one field changes if you are using doctrine
  243.             // otherwise the event listeners won't be called and the file is lost
  244.             $this->docUpdatedAtEn = new \DateTimeImmutable();
  245.         }
  246.     }
  247.     public function getDocumentEn(): ?File
  248.     {
  249.         return $this->documentEn;
  250.     }
  251.     public function getDocNameEn(): ?string
  252.     {
  253.         return $this->docNameEn;
  254.     }
  255.     public function setDocNameEn(?string $docNameEn): static
  256.     {
  257.         $this->docNameEn $docNameEn;
  258.         return $this;
  259.     }
  260.     public function getDocSizeEn(): ?int
  261.     {
  262.         return $this->docSizeEn;
  263.     }
  264.     public function setDocSizeEn(?int $docSizeEn): static
  265.     {
  266.         $this->docSizeEn $docSizeEn;
  267.         return $this;
  268.     }
  269.     public function getDocUpdatedAtEn(): ?\DateTimeImmutable
  270.     {
  271.         return $this->docUpdatedAtEn;
  272.     }
  273.     public function setDocUpdatedAtEn(?\DateTimeImmutable $docUpdatedAtEn): static
  274.     {
  275.         $this->docUpdatedAtEn $docUpdatedAtEn;
  276.         return $this;
  277.     }
  278. }