src/Entity/EvenementsGroupeAll/AvisEvenement.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\EvenementsGroupeAll;
  3. use App\Entity\Adherent\Magasin;
  4. use App\Repository\EvenementsGroupeAll\AvisEvenementRepository;
  5. use DateTimeImmutable;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Table(name'avis_evenement')]
  11. #[ORM\Entity(repositoryClassAvisEvenementRepository::class)]
  12. class AvisEvenement
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  19.     private ?string $message;
  20.     #[ORM\Column(nullablefalse)]
  21.     private bool $publishPictures;
  22.     #[ORM\OneToMany(mappedBy'avisEvenement'targetEntityImgEvenement::class)]
  23.     private Collection $images;
  24.     #[ORM\Column(length255nullablefalse)]
  25.     private ?string $nomMag;
  26.     #[ORM\Column(length255)]
  27.     private string $type;
  28.     #[ORM\ManyToOne(inversedBy'avisEvenement')]
  29.     #[ORM\JoinColumn(referencedColumnName"k_adherent"nullablefalse)]
  30.     private Magasin $k_adh;
  31.     #[ORM\Column]
  32.     private DateTimeImmutable $createdAt;
  33.     public function __construct()
  34.     {
  35.         $this->images = new ArrayCollection();
  36.         $this->createdAt = new \DateTimeImmutable('now');
  37.         $this->publishPictures false;
  38.     }
  39.     public function getId(): int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getMessage(): ?string
  44.     {
  45.         return $this->message;
  46.     }
  47.     public function setMessage(?string $message): self
  48.     {
  49.         $this->message $message;
  50.         return $this;
  51.     }
  52.     public function isPublishPictures(): bool
  53.     {
  54.         return $this->publishPictures;
  55.     }
  56.     public function setPublishPictures(bool $publishPictures): self
  57.     {
  58.         $this->publishPictures $publishPictures;
  59.         return $this;
  60.     }
  61.     /**
  62.      * @return Collection<int, ImgEvenement>
  63.      */
  64.     public function getImages(): Collection
  65.     {
  66.         return $this->images;
  67.     }
  68.     public function addImage(ImgEvenement $image): self
  69.     {
  70.         if (!$this->images->contains($image)) {
  71.             $this->images->add($image);
  72.             $image->setAvisEvenement($this);
  73.         }
  74.         return $this;
  75.     }
  76.     public function removeImage(ImgEvenement $image): self
  77.     {
  78.         if ($this->images->removeElement($image)) {
  79.             // set the owning side to null (unless already changed)
  80.             if ($image->getAvisEvenement() === $this) {
  81.                 $image->setAvisEvenement(null);
  82.             }
  83.         }
  84.         return $this;
  85.     }
  86.     public function getNomMag(): string
  87.     {
  88.         return $this->nomMag;
  89.     }
  90.     public function setNomMag(string $nomMag): static
  91.     {
  92.         $this->nomMag $nomMag;
  93.         return $this;
  94.     }
  95.     public function getType(): string
  96.     {
  97.         return $this->type;
  98.     }
  99.     public function setType(string $type): static
  100.     {
  101.         $this->type $type;
  102.         return $this;
  103.     }
  104.     public function getKAdh(): Magasin
  105.     {
  106.         return $this->k_adh;
  107.     }
  108.     public function setKAdh(Magasin $k_adh): static
  109.     {
  110.         $this->k_adh $k_adh;
  111.         return $this;
  112.     }
  113.     public function getCreatedAt(): DateTimeImmutable
  114.     {
  115.         return $this->createdAt;
  116.     }
  117.     public function setCreatedAt(DateTimeImmutable $createdAt): static
  118.     {
  119.         $this->createdAt $createdAt;
  120.         return $this;
  121.     }
  122. }