src/Entity/Club1895/Club1895Profile.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Club1895;
  3. use App\Entity\Address;
  4. use App\Entity\Person;
  5. use App\Repository\Club1895\Club1895ProfileRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Validator\Constraints\NotBlank;
  11. #[ORM\Entity(repositoryClassClub1895ProfileRepository::class)]
  12. class Club1895Profile
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\OneToOne(inversedBy'club1895Profile'cascade: ['persist''remove'])]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?Person $person null;
  21.     #[ORM\Column(length255)]
  22.     #[NotBlank]
  23.     private ?string $email null;
  24.     #[ORM\Column(length40nullabletrue)]
  25.     private ?string $phone null;
  26.     #[ORM\Column(length255)]
  27.     #[NotBlank]
  28.     private ?string $company null;
  29.     #[ORM\Column(length255)]
  30.     #[NotBlank]
  31.     private ?string $jobTitle null;
  32.     #[ORM\Column(typeTypes::SMALLINT)]
  33.     #[NotBlank]
  34.     private ?int $yearsOfExperience null;
  35.     #[ORM\Embedded(class: Address::class)]
  36.     #[NotBlank]
  37.     private $address;
  38.     #[ORM\Column(typeTypes::TEXT)]
  39.     #[NotBlank]
  40.     private ?string $presentation null;
  41.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  42.     private ?string $offer null;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $linkedinUrl null;
  45.     #[ORM\Column(length255nullabletrue)]
  46.     private ?string $websiteUrl null;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $calendarUrl null;
  49.     #[ORM\OneToMany(mappedBy'profile'targetEntityRegistration::class, orphanRemovaltrue)]
  50.     private Collection $registrations;
  51.     public function __construct()
  52.     {
  53.         $this->registrations = new ArrayCollection();
  54.     }
  55.     public function getId(): ?int
  56.     {
  57.         return $this->id;
  58.     }
  59.     public function getPerson(): ?Person
  60.     {
  61.         return $this->person;
  62.     }
  63.     public function setPerson(Person $person): self
  64.     {
  65.         $this->person $person;
  66.         return $this;
  67.     }
  68.     public function getEmail(): ?string
  69.     {
  70.         return $this->email;
  71.     }
  72.     public function setEmail(string $email): self
  73.     {
  74.         $this->email $email;
  75.         return $this;
  76.     }
  77.     public function getPhone(): ?string
  78.     {
  79.         return $this->phone;
  80.     }
  81.     public function setPhone(?string $phone): self
  82.     {
  83.         $this->phone $phone;
  84.         return $this;
  85.     }
  86.     public function getCompany(): ?string
  87.     {
  88.         return $this->company;
  89.     }
  90.     public function setCompany(string $company): self
  91.     {
  92.         $this->company $company;
  93.         return $this;
  94.     }
  95.     public function getJobTitle(): ?string
  96.     {
  97.         return $this->jobTitle;
  98.     }
  99.     public function setJobTitle(string $jobTitle): self
  100.     {
  101.         $this->jobTitle $jobTitle;
  102.         return $this;
  103.     }
  104.     public function getYearsOfExperience(): ?int
  105.     {
  106.         return $this->yearsOfExperience;
  107.     }
  108.     public function setYearsOfExperience(int $yearsOfExperience): self
  109.     {
  110.         $this->yearsOfExperience $yearsOfExperience;
  111.         return $this;
  112.     }
  113.     public function getAddress(): ?Address
  114.     {
  115.         return $this->address;
  116.     }
  117.     public function setAddress(?Address $address)
  118.     {
  119.         $this->address $address;
  120.         return $this;
  121.     }
  122.     public function getPresentation(): ?string
  123.     {
  124.         return $this->presentation;
  125.     }
  126.     public function setPresentation(string $presentation): self
  127.     {
  128.         $this->presentation $presentation;
  129.         return $this;
  130.     }
  131.     public function getOffer(): ?string
  132.     {
  133.         return $this->offer;
  134.     }
  135.     public function setOffer(?string $offer): self
  136.     {
  137.         $this->offer $offer;
  138.         return $this;
  139.     }
  140.     public function getLinkedinUrl(): ?string
  141.     {
  142.         return $this->linkedinUrl;
  143.     }
  144.     public function setLinkedinUrl(?string $linkedinUrl): self
  145.     {
  146.         $this->linkedinUrl $linkedinUrl;
  147.         return $this;
  148.     }
  149.     public function getWebsiteUrl(): ?string
  150.     {
  151.         return $this->websiteUrl;
  152.     }
  153.     public function setWebsiteUrl(?string $websiteUrl): self
  154.     {
  155.         $this->websiteUrl $websiteUrl;
  156.         return $this;
  157.     }
  158.     public function getCalendarUrl(): ?string
  159.     {
  160.         return $this->calendarUrl;
  161.     }
  162.     public function setCalendarUrl(?string $calendarUrl): self
  163.     {
  164.         $this->calendarUrl $calendarUrl;
  165.         return $this;
  166.     }
  167.     /**
  168.      * @return Collection<int, Registration>
  169.      */
  170.     public function getRegistrations(): Collection
  171.     {
  172.         return $this->registrations;
  173.     }
  174.     public function getActiveRegistration(): ?Registration
  175.     {
  176.         return $this->getRegistrations()
  177.             ->filter(fn(Registration $r) => $r->getGlobalSeason()?->getIsActive())
  178.             ->first() ?: null;
  179.     }
  180.     public function addRegistration(Registration $registration): self
  181.     {
  182.         if (!$this->registrations->contains($registration)) {
  183.             $this->registrations->add($registration);
  184.             $registration->setProfile($this);
  185.         }
  186.         return $this;
  187.     }
  188.     public function removeRegistration(Registration $registration): self
  189.     {
  190.         if ($this->registrations->removeElement($registration)) {
  191.             // set the owning side to null (unless already changed)
  192.             if ($registration->getProfile() === $this) {
  193.                 $registration->setProfile(null);
  194.             }
  195.         }
  196.         return $this;
  197.     }
  198. }