src/Entity/CoachInfo.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CoachInfoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCoachInfoRepository::class)]
  8. class CoachInfo
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $name;
  16.     #[ORM\OneToOne(targetEntityCoach::class, inversedBy'coachInfo'cascade: ['persist''remove'])]
  17.     private $owner;
  18.     #[ORM\OneToMany(targetEntityFormation::class, mappedBy'coach')]
  19.     private $formation;
  20.     #[ORM\OneToMany(targetEntityExperience::class, mappedBy'coach')]
  21.     private $experience;
  22.     #[ORM\Column(type'text'nullabletrue)]
  23.     private $description;
  24.     #[ORM\OneToOne(targetEntityAddress::class, cascade: ['persist''remove'])]
  25.     private $address;
  26.     #[ORM\ManyToMany(targetEntityCourse::class, mappedBy'coachsInfos')]
  27.     private $courses;
  28.     #[ORM\Column(type'datetime_immutable'nullabletrueoptions: ['default' => 'CURRENT_TIMESTAMP'])]
  29.     private $createdAt;
  30.     #[ORM\Column(length255nullabletrue)]
  31.     private ?string $image null;
  32.     #[ORM\ManyToOne(targetEntityClub::class, inversedBy'createdCoachInfos')]
  33.     #[ORM\JoinColumn(nullabletrue)]
  34.     private ?Club $createdByClub null;
  35.     #[ORM\ManyToOne(targetEntityOperator::class, inversedBy'createdCoachInfos')]
  36.     #[ORM\JoinColumn(nullabletrue)]
  37.     private ?Operator $createdByOperator null;
  38.     public function __construct()
  39.     {
  40.         $this->formation = new ArrayCollection();
  41.         $this->experience = new ArrayCollection();
  42.         $this->courses = new ArrayCollection();
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getName(): ?string
  49.     {
  50.         return $this->name;
  51.     }
  52.     public function setName(string $name): self
  53.     {
  54.         $this->name $name;
  55.         return $this;
  56.     }
  57.     public function getOwner(): ?Coach
  58.     {
  59.         return $this->owner;
  60.     }
  61.     public function setOwner(?Coach $owner): self
  62.     {
  63.         $this->owner $owner;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection|Formation[]
  68.      */
  69.     public function getFormation(): Collection
  70.     {
  71.         return $this->formation;
  72.     }
  73.     public function addFormation(Formation $formation): self
  74.     {
  75.         if (!$this->formation->contains($formation)) {
  76.             $this->formation[] = $formation;
  77.             $formation->setCoach($this);
  78.         }
  79.         return $this;
  80.     }
  81.     public function removeFormation(Formation $formation): self
  82.     {
  83.         if ($this->formation->removeElement($formation)) {
  84.             // set the owning side to null (unless already changed)
  85.             if ($formation->getCoach() === $this) {
  86.                 $formation->setCoach(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection|Experience[]
  93.      */
  94.     public function getExperience(): Collection
  95.     {
  96.         return $this->experience;
  97.     }
  98.     public function addExperience(Experience $experience): self
  99.     {
  100.         if (!$this->experience->contains($experience)) {
  101.             $this->experience[] = $experience;
  102.             $experience->setCoach($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeExperience(Experience $experience): self
  107.     {
  108.         if ($this->experience->removeElement($experience)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($experience->getCoach() === $this) {
  111.                 $experience->setCoach(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116.     public function getDescription()
  117.     {
  118.         return $this->description;
  119.     }
  120.     public function setDescription($description)
  121.     {
  122.         $this->description $description;
  123.         return $this;
  124.     }
  125.     public function getAddress(): ?Address
  126.     {
  127.         return $this->address;
  128.     }
  129.     public function setAddress(?Address $address): self
  130.     {
  131.         $this->address $address;
  132.         return $this;
  133.     }
  134.     /**
  135.      * @return Collection<int, Course>
  136.      */
  137.     public function getCourses(): Collection
  138.     {
  139.         return $this->courses;
  140.     }
  141.     public function addCourse(Course $course): self
  142.     {
  143.         if (!$this->courses->contains($course)) {
  144.             $this->courses[] = $course;
  145.             $course->addCoachsInfo($this);
  146.         }
  147.         return $this;
  148.     }
  149.     public function removeCourse(Course $course): self
  150.     {
  151.         if ($this->courses->removeElement($course)) {
  152.             $course->removeCoachsInfo($this);
  153.         }
  154.         return $this;
  155.     }
  156.     public function getCreatedAt(): ?\DateTimeImmutable
  157.     {
  158.         return $this->createdAt;
  159.     }
  160.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  161.     {
  162.         $this->createdAt $createdAt;
  163.         return $this;
  164.     }
  165.     public function getImage(): ?string
  166.     {
  167.         return $this->image;
  168.     }
  169.     public function setImage(?string $image): static
  170.     {
  171.         $this->image $image;
  172.         return $this;
  173.     }
  174.     public function getCreatedByClub(): ?Club
  175.     {
  176.         return $this->createdByClub;
  177.     }
  178.     public function setCreatedByClub(?Club $createdByClub): self
  179.     {
  180.         $this->createdByClub $createdByClub;
  181.         return $this;
  182.     }
  183.     public function getCreatedByOperator(): ?Operator
  184.     {
  185.         return $this->createdByOperator;
  186.     }
  187.     public function setCreatedByOperator(?Operator $createdByOperator): self
  188.     {
  189.         $this->createdByOperator $createdByOperator;
  190.         return $this;
  191.     }
  192. }