src/Entity/Jury.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\JuryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassJuryRepository::class)]
  8. class Jury
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private ?string $name null;
  16.     #[ORM\Column(type'date'nullabletrue)]
  17.     private ?\DateTimeInterface $date null;
  18.     #[ORM\OneToMany(targetEntityProfile::class, mappedBy'jury')]
  19.     #[ORM\OrderBy(['id' => 'DESC'])]
  20.     private Collection $profiles;
  21.     public function __construct()
  22.     {
  23.         $this->profiles = new ArrayCollection();
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getName(): ?string
  30.     {
  31.         return $this->name;
  32.     }
  33.     public function setName(?string $name): self
  34.     {
  35.         $this->name $name;
  36.         return $this;
  37.     }
  38.     public function getDate(): ?\DateTimeInterface
  39.     {
  40.         return $this->date;
  41.     }
  42.     public function setDate(?\DateTimeInterface $date): self
  43.     {
  44.         $this->date $date;
  45.         return $this;
  46.     }
  47.     /**
  48.      * @return Collection<int, Profile>
  49.      */
  50.     public function getProfiles(): Collection
  51.     {
  52.         return $this->profiles;
  53.     }
  54.     public function addProfile(Profile $profile): self
  55.     {
  56.         if (!$this->profiles->contains($profile)) {
  57.             $this->profiles[] = $profile;
  58.             $profile->setJury($this);
  59.         }
  60.         return $this;
  61.     }
  62.     public function removeProfile(Profile $profile): self
  63.     {
  64.         if ($this->profiles->removeElement($profile)) {
  65.             // set the owning side to null (unless already changed)
  66.             if ($profile->getJury() === $this) {
  67.                 $profile->setJury(null);
  68.             }
  69.         }
  70.         return $this;
  71.     }
  72. }