src/Entity/Planning.php line 13
<?phpnamespace App\Entity;use App\Repository\PlanningRepository;use DateTimeImmutable;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PlanningRepository::class)]class Planning{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $title = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\Column(nullable: true)]private ?DateTimeImmutable $startedAt = null;#[ORM\Column(nullable: true)]private ?DateTimeImmutable $endedAt = null;#[ORM\ManyToOne(inversedBy: 'plannings')]private ?Establishment $establishment = null;#[ORM\Column(length: 255)]private ?string $type = null;#[ORM\ManyToOne(inversedBy: 'createdPlannings')]private ?User $author = null;#[ORM\ManyToMany(targetEntity: Department::class, inversedBy: 'plannings')]private Collection $departments;#[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'plannings')]private Collection $users;public function __construct(){$this->departments = new ArrayCollection();$this->users = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function getTitle(): ?string{return $this->title;}public function setTitle(string $title): self{$this->title = $title;return $this;}public function getStartedAt(): ?DateTimeImmutable{return $this->startedAt;}public function setStartedAt(?DateTimeImmutable $startedAt): self{$this->startedAt = $startedAt;return $this;}public function getEndedAt(): ?DateTimeImmutable{return $this->endedAt;}public function setEndedAt(?DateTimeImmutable $endedAt): self{$this->endedAt = $endedAt;return $this;}public function getEstablishment(): ?Establishment{return $this->establishment;}public function setEstablishment(?Establishment $establishment): self{$this->establishment = $establishment;return $this;}public function getType(): ?string{return $this->type;}public function setType(string $type): static{$this->type = $type;return $this;}public function getAuthor(): ?User{return $this->author;}public function setAuthor(?User $author): static{$this->author = $author;return $this;}/*** @return Collection<int, Department>*/public function getDepartments(): Collection{return $this->departments;}public function addDepartment(Department $department): static{if (!$this->departments->contains($department)) {$this->departments->add($department);}return $this;}public function removeDepartment(Department $department): static{$this->departments->removeElement($department);return $this;}/*** @return Collection<int, User>*/public function getUsers(): Collection{return $this->users;}public function addUser(User $user): static{if (!$this->users->contains($user)) {$this->users->add($user);}return $this;}public function removeUser(User $user): static{$this->users->removeElement($user);return $this;}}