<?phpnamespace App\Entity\EvenementsGroupeAll;use App\Entity\Adherent\Magasin;use App\Repository\EvenementsGroupeAll\AvisEvenementRepository;use DateTimeImmutable;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Table(name: 'avis_evenement')]#[ORM\Entity(repositoryClass: AvisEvenementRepository::class)]class AvisEvenement{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $message; #[ORM\Column(nullable: false)] private bool $publishPictures; #[ORM\OneToMany(mappedBy: 'avisEvenement', targetEntity: ImgEvenement::class)] private Collection $images; #[ORM\Column(length: 255, nullable: false)] private ?string $nomMag; #[ORM\Column(length: 255)] private string $type; #[ORM\ManyToOne(inversedBy: 'avisEvenement')] #[ORM\JoinColumn(referencedColumnName: "k_adherent", nullable: false)] private Magasin $k_adh; #[ORM\Column] private DateTimeImmutable $createdAt; public function __construct() { $this->images = new ArrayCollection(); $this->createdAt = new \DateTimeImmutable('now'); $this->publishPictures = false; } public function getId(): int { return $this->id; } public function getMessage(): ?string { return $this->message; } public function setMessage(?string $message): self { $this->message = $message; return $this; } public function isPublishPictures(): bool { return $this->publishPictures; } public function setPublishPictures(bool $publishPictures): self { $this->publishPictures = $publishPictures; return $this; } /** * @return Collection<int, ImgEvenement> */ public function getImages(): Collection { return $this->images; } public function addImage(ImgEvenement $image): self { if (!$this->images->contains($image)) { $this->images->add($image); $image->setAvisEvenement($this); } return $this; } public function removeImage(ImgEvenement $image): self { if ($this->images->removeElement($image)) { // set the owning side to null (unless already changed) if ($image->getAvisEvenement() === $this) { $image->setAvisEvenement(null); } } return $this; } public function getNomMag(): string { return $this->nomMag; } public function setNomMag(string $nomMag): static { $this->nomMag = $nomMag; return $this; } public function getType(): string { return $this->type; } public function setType(string $type): static { $this->type = $type; return $this; } public function getKAdh(): Magasin { return $this->k_adh; } public function setKAdh(Magasin $k_adh): static { $this->k_adh = $k_adh; return $this; } public function getCreatedAt(): DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(DateTimeImmutable $createdAt): static { $this->createdAt = $createdAt; return $this; }}