Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

src/Entity/MeetingState.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MeetingStateRepository;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use JsonSerializable;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. /**
  10.  * @ORM\Entity(repositoryClass=MeetingStateRepository::class)
  11.  * @UniqueEntity(fields="name", message="Meeting state name is already taken.")
  12.  */
  13. class MeetingState implements JsonSerializable
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\OneToMany(targetEntity="Meeting", mappedBy="meetingState")
  27.      */
  28.     private $meetings;
  29.     public function __construct() {
  30.         $this->meetings = new ArrayCollection();
  31.     }
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getName(): ?string
  37.     {
  38.         return $this->name;
  39.     }
  40.     public function setName(string $name): self
  41.     {
  42.         $this->name $name;
  43.         return $this;
  44.     }
  45.     
  46.     public function jsonSerialize()
  47.     {
  48.         $vars get_object_vars($this);
  49.         return $vars;
  50.     }
  51.     /**
  52.      * @return Collection<int, Meeting>
  53.      */
  54.     public function getMeetings(): Collection
  55.     {
  56.         return $this->meetings;
  57.     }
  58.     public function addMeeting(Meeting $meeting): static
  59.     {
  60.         if (!$this->meetings->contains($meeting)) {
  61.             $this->meetings->add($meeting);
  62.             $meeting->setMeetingState($this);
  63.         }
  64.         return $this;
  65.     }
  66.     public function removeMeeting(Meeting $meeting): static
  67.     {
  68.         if ($this->meetings->removeElement($meeting)) {
  69.             // set the owning side to null (unless already changed)
  70.             if ($meeting->getMeetingState() === $this) {
  71.                 $meeting->setMeetingState(null);
  72.             }
  73.         }
  74.         return $this;
  75.     }
  76. }