src/Entity/Doctor.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DoctorRepository;
  4. use Boab\CmsBundle\Entity\User;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassDoctorRepository::class)]
  9. class Doctor extends User implements DoctorInterface
  10. {
  11.     use UserTrait;
  12.     #[ORM\Column(length255nullabletrue)]
  13.     private ?string $clinicName null;
  14.     #[ORM\Column(length100nullabletrue)]
  15.     private ?string $clinicAddress null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $services null;
  18.     #[ORM\Column(length20nullabletrue)]
  19.     private ?string $ipAddress null;
  20.     #[ORM\OneToMany(mappedBy'doctor'targetEntityAppointment::class, cascade: ['persist''remove'], orphanRemovaltrue)]
  21.     private Collection $appointments;
  22.     #[ORM\OneToMany(mappedBy'createdBy'targetEntityTimeSlot::class, cascade: ['persist''remove'], orphanRemovaltrue)]
  23.     private Collection $timeSlots;
  24.     #[ORM\ManyToMany(targetEntitySpecialty::class, inversedBy'doctors')]
  25.     private Collection $specialties;
  26.     #[ORM\Column(length30nullabletrue)]
  27.     private ?string $pricing null;
  28.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  29.     private ?PricingPlan $pricingPlan null;
  30.     #[ORM\OneToMany(mappedBy'doctor'targetEntityReview::class, cascade: ['persist'], orphanRemovaltrue)]
  31.     private Collection $reviews;
  32.     public function __construct()
  33.     {
  34.         parent::__construct();
  35.         $this->appointments = new ArrayCollection();
  36.         $this->specialties = new ArrayCollection();
  37.         $this->timeSlots = new ArrayCollection();
  38.         $this->reviews = new ArrayCollection();        
  39.     }
  40.     public function getClinicName(): ?string
  41.     {
  42.         return $this->clinicName;
  43.     }
  44.     public function setClinicName(?string $clinicName): self
  45.     {
  46.         $this->clinicName $clinicName;
  47.         return $this;
  48.     }
  49.     public function getClinicAddress(): ?string
  50.     {
  51.         return $this->clinicAddress;
  52.     }
  53.     public function setClinicAddress(?string $clinicAddress): self
  54.     {
  55.         $this->clinicAddress $clinicAddress;
  56.         return $this;
  57.     }
  58.     public function getServices(): ?string
  59.     {
  60.         return $this->services;
  61.     }
  62.     public function setServices(?string $services): self
  63.     {
  64.         $this->services $services;
  65.         return $this;
  66.     }
  67.     public function getIpAddress(): ?string
  68.     {
  69.         return $this->ipAddress;
  70.     }
  71.     public function setIpAddress(?string $ipAddress): self
  72.     {
  73.         $this->ipAddress $ipAddress;
  74.         return $this;
  75.     }
  76.     /**
  77.      * @return Collection<int, Appointment>
  78.      */
  79.     public function getAppointments(): Collection
  80.     {
  81.         return $this->appointments;
  82.     }
  83.     public function addAppointment(Appointment $appointment): self
  84.     {
  85.         if (!$this->appointments->contains($appointment)) {
  86.             $this->appointments->add($appointment);
  87.             $appointment->setDoctor($this);
  88.         }
  89.         return $this;
  90.     }
  91.     public function removeAppointment(Appointment $appointment): self
  92.     {
  93.         if ($this->appointments->removeElement($appointment)) {
  94.             // set the owning side to null (unless already changed)
  95.             if ($appointment->getDoctor() === $this) {
  96.                 $appointment->setDoctor(null);
  97.             }
  98.         }
  99.         return $this;
  100.     }
  101.     /**
  102.      * @return Collection<int, Specialty>
  103.      */
  104.     public function getSpecialties(): Collection
  105.     {
  106.         return $this->specialties;
  107.     }
  108.     public function addSpecialty(Specialty $specialty): static
  109.     {
  110.         if (!$this->specialties->contains($specialty)) {
  111.             $this->specialties->add($specialty);
  112.         }
  113.         return $this;
  114.     }
  115.     public function removeSpecialty(Specialty $specialty): static
  116.     {
  117.         $this->specialties->removeElement($specialty);
  118.         return $this;
  119.     }
  120.     public function getPricing(): ?string
  121.     {
  122.         return $this->pricing;
  123.     }
  124.     public function setPricing(string $pricing): static
  125.     {
  126.         $this->pricing $pricing;
  127.         return $this;
  128.     }
  129.     public function getPricingPlan(): ?PricingPlan
  130.     {
  131.         return $this->pricingPlan;
  132.     }
  133.     public function setPricingPlan(?PricingPlan $pricingPlan): static
  134.     {
  135.         $this->pricingPlan $pricingPlan;
  136.         return $this;
  137.     }
  138.     /**
  139.      * @return Collection<int, Scheduler>
  140.      */
  141.     public function getTimeSlots(): Collection
  142.     {
  143.         return $this->timeSlots;
  144.     }
  145.     public function addTimeSlot(TimeSlot $timeSlot): static
  146.     {
  147.         if (!$this->timeSlots->contains($timeSlot)) {
  148.             $this->timeSlots->add($timeSlot);
  149.             $timeSlot->setCreatedBy($this);
  150.         }
  151.         return $this;
  152.     }
  153.     public function removeTimeSlot(TimeSlot $timeSlot): static
  154.     {
  155.         if ($this->timeSlots->removeElement($timeSlot)) {
  156.             // set the owning side to null (unless already changed)
  157.             if ($timeSlot->getCreatedBy() === $this) {
  158.                 $timeSlot->setCreatedBy(null);
  159.             }
  160.         }
  161.         return $this;
  162.     }
  163.     /**
  164.      * @return Collection<int, Review>
  165.      */
  166.     public function getReviews(): Collection
  167.     {
  168.         return $this->reviews;
  169.     }
  170.     public function addReview(Review $review): static
  171.     {
  172.         if (!$this->reviews->contains($review)) {
  173.             $this->reviews->add($review);
  174.             $review->setDoctor($this);
  175.         }
  176.         return $this;
  177.     }
  178.     public function removeReview(Review $review): static
  179.     {
  180.         if ($this->reviews->removeElement($review)) {
  181.             // set the owning side to null (unless already changed)
  182.             if ($review->getDoctor() === $this) {
  183.                 $review->setDoctor(null);
  184.             }
  185.         }
  186.         return $this;
  187.     }
  188.     public function getUserType(): string 
  189.     {
  190.         return 'Doctor';
  191.     }
  192. }