<?php
namespace App\Entity;
use App\Repository\EventRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EventRepository::class)]
class Event
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $title = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $startDateTime = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $endDateTime = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $updatedAt = null;
#[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'events')]
private Collection $users;
#[ORM\Column(nullable: true)]
private ?bool $all_day = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $background_color = null;
#[ORM\Column(length: 7, nullable: true)]
private ?string $border_color = null;
#[ORM\Column(length: 7, nullable: true)]
private ?string $text_color = null;
public function __construct()
{
$this->users = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): static
{
$this->title = $title;
return $this;
}
public function getStartDateTime(): ?\DateTimeInterface
{
return $this->startDateTime;
}
public function setStartDateTime(?\DateTimeInterface $startDateTime): static
{
$this->startDateTime = $startDateTime;
return $this;
}
public function getEndDateTime(): ?\DateTimeInterface
{
return $this->endDateTime;
}
public function setEndDateTime(?\DateTimeInterface $endDateTime): static
{
$this->endDateTime = $endDateTime;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
{
$this->updatedAt = $updatedAt;
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;
}
public function isAllDay(): ?bool
{
return $this->all_day;
}
public function setAllDay(?bool $all_day): static
{
$this->all_day = $all_day;
return $this;
}
public function getBackgroundColor(): ?string
{
return $this->background_color;
}
public function setBackgroundColor(?string $background_color): static
{
$this->background_color = $background_color;
return $this;
}
public function getBorderColor(): ?string
{
return $this->border_color;
}
public function setBorderColor(?string $border_color): static
{
$this->border_color = $border_color;
return $this;
}
public function getTextColor(): ?string
{
return $this->text_color;
}
public function setTextColor(string $text_color): static
{
$this->text_color = $text_color;
return $this;
}
}