src/Entity/Actualite.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\ActualiteRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassActualiteRepository::class)]
  10. #[ApiResource]
  11. class Actualite
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $titre null;
  19.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  20.     private ?\DateTimeInterface $date null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $image null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $imagedetails null;
  25.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  26.     private ?string $description null;
  27.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  28.     private ?string $desccourt null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $nbvue null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $nbcommentaire null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $slug null;
  35.     #[ORM\OneToMany(mappedBy'actualite'targetEntityTrace::class,cascade: ['remove'])]
  36.     private Collection $traces;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $type null;
  39.     public function __construct()
  40.     {
  41.         $this->traces = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getTitre(): ?string
  48.     {
  49.         return $this->titre;
  50.     }
  51.     public function setTitre(?string $titre): self
  52.     {
  53.         $this->titre $titre;
  54.         return $this;
  55.     }
  56.     public function getDate(): ?\DateTimeInterface
  57.     {
  58.         return $this->date;
  59.     }
  60.     public function setDate(?\DateTimeInterface $date): self
  61.     {
  62.         $this->date $date;
  63.         return $this;
  64.     }
  65.     public function getImage(): ?string
  66.     {
  67.         return $this->image;
  68.     }
  69.     public function setImage(?string $image): self
  70.     {
  71.         $this->image $image;
  72.         return $this;
  73.     }
  74.     public function getImagedetails(): ?string
  75.     {
  76.         return $this->imagedetails;
  77.     }
  78.     public function setImagedetails(?string $imagedetails): self
  79.     {
  80.         $this->imagedetails $imagedetails;
  81.         return $this;
  82.     }
  83.     public function getDescription(): ?string
  84.     {
  85.         return $this->description;
  86.     }
  87.     public function setDescription(?string $description): self
  88.     {
  89.         $this->description $description;
  90.         return $this;
  91.     }
  92.     public function getDesccourt(): ?string
  93.     {
  94.         return $this->desccourt;
  95.     }
  96.     public function setDesccourt(?string $desccourt): self
  97.     {
  98.         $this->desccourt $desccourt;
  99.         return $this;
  100.     }
  101.     public function getNbvue(): ?string
  102.     {
  103.         return $this->nbvue;
  104.     }
  105.     public function setNbvue(?string $nbvue): self
  106.     {
  107.         $this->nbvue $nbvue;
  108.         return $this;
  109.     }
  110.     public function getNbcommentaire(): ?string
  111.     {
  112.         return $this->nbcommentaire;
  113.     }
  114.     public function setNbcommentaire(?string $nbcommentaire): self
  115.     {
  116.         $this->nbcommentaire $nbcommentaire;
  117.         return $this;
  118.     }
  119.     public function getSlug(): ?string
  120.     {
  121.         return $this->slug;
  122.     }
  123.     public function setSlug(?string $slug): self
  124.     {
  125.         $this->slug $slug;
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection<int, Trace>
  130.      */
  131.     public function getTraces(): Collection
  132.     {
  133.         return $this->traces;
  134.     }
  135.     public function addTrace(Trace $trace): self
  136.     {
  137.         if (!$this->traces->contains($trace)) {
  138.             $this->traces->add($trace);
  139.             $trace->setActualite($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeTrace(Trace $trace): self
  144.     {
  145.         if ($this->traces->removeElement($trace)) {
  146.             // set the owning side to null (unless already changed)
  147.             if ($trace->getActualite() === $this) {
  148.                 $trace->setActualite(null);
  149.             }
  150.         }
  151.         return $this;
  152.     }
  153.     public function getType(): ?string
  154.     {
  155.         return $this->type;
  156.     }
  157.     public function setType(?string $type): self
  158.     {
  159.         $this->type $type;
  160.         return $this;
  161.     }
  162. }