<?php
namespace App\Entity;
use App\Repository\EvenementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: EvenementRepository::class)]
class Evenement
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $titre;
#[ORM\Column(type: 'text', nullable: true)]
private $description;
#[ORM\Column(type: 'date', nullable: true)]
private $date;
#[ORM\Column(type: 'time', nullable: true)]
private $heure;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $lieu;
#[ORM\ManyToOne(targetEntity: TypeEvenement::class, inversedBy: 'evenements')]
private $type;
#[Gedmo\Timestampable(on: 'create')]
#[ORM\Column(type: 'datetime')]
private $created_at;
#[Gedmo\Timestampable(on: 'update')]
#[ORM\Column(type: 'datetime')]
private $updated_at;
#[ORM\Column(type: 'integer')]
private $created_by;
#[ORM\Column(type: 'integer')]
private $updated_by;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $file;
#[ORM\Column(type: 'boolean', nullable: true)]
private $une=false;
#[ORM\Column(length: 255, nullable: true)]
private ?string $photo = null;
#[ORM\ManyToOne(inversedBy: 'evenements')]
private ?Groupe $groupe = null;
#[ORM\OneToMany(mappedBy: 'evenement', targetEntity: CommentaireEvenement::class)]
private Collection $commentaires;
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getHeure(): ?\DateTimeInterface
{
return $this->heure;
}
public function setHeure(?\DateTimeInterface $heure): self
{
$this->heure = $heure;
return $this;
}
public function getLieu(): ?string
{
return $this->lieu;
}
public function setLieu(?string $lieu): self
{
$this->lieu = $lieu;
return $this;
}
public function getType(): ?TypeEvenement
{
return $this->type;
}
public function setType(?TypeEvenement $type): self
{
$this->type = $type;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function getCreatedBy(): ?int
{
return $this->created_by;
}
public function setCreatedBy(int $created_by): self
{
$this->created_by = $created_by;
return $this;
}
public function getUpdatedBy(): ?int
{
return $this->updated_by;
}
public function setUpdatedBy(int $updated_by): self
{
$this->updated_by = $updated_by;
return $this;
}
public function getFile(): ?string
{
return $this->file;
}
public function setFile(?string $file): self
{
$this->file = $file;
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(?string $photo): self
{
$this->photo = $photo;
return $this;
}
public function isUne(): ?bool
{
return $this->une;
}
public function setUne(?bool $une): self
{
$this->une = $une;
return $this;
}
public function getGroupe(): ?Groupe
{
return $this->groupe;
}
public function setGroupe(?Groupe $groupe): self
{
$this->groupe = $groupe;
return $this;
}
/**
* @return Collection<int, Commentaire>
*/
public function getCommentaires(): Collection
{
return $this->commentaires;
}
public function addCommentaire(Commentaire $commentaire): self
{
if (!$this->commentaires->contains($commentaire)) {
$this->commentaires->add($commentaire);
$commentaire->setEvenement($this);
}
return $this;
}
public function removeCommentaire(Commentaire $commentaire): self
{
if ($this->commentaires->removeElement($commentaire)) {
// set the owning side to null (unless already changed)
if ($commentaire->setEvenement() === $this) {
$commentaire->setEvenement(null);
}
}
return $this;
}
}