<?php
namespace App\Entity\Actualites;
use App\Entity\Ecoles\Ecoles;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* Actualites
*
* @ORM\Table(name="actualites", indexes={@ORM\Index(name="actif", columns={"actif"}), @ORM\Index(name="langue", columns={"langue"})})
* @ORM\Entity(repositoryClass="App\Repository\Actualites\ActualitesRepository")
*/
class Actualites
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned":true})
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Actualites\ActualitesCat", inversedBy="actualites")
* @ORM\JoinColumn(name="id_cat1", referencedColumnName="id", nullable=true)
*/
private $idCat1;
/**
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Actualites\ActualitesCat", inversedBy="actualites")
* @ORM\JoinColumn(name="id_cat2", referencedColumnName="id", nullable=true)
*/
private $idCat2;
/**
* @var string
*
* @ORM\Column(name="titre_url", type="string", length=255, nullable=false)
*/
private $titreUrl = '';
/**
* @var string
*
* @ORM\Column(name="titre", type="string", length=255, nullable=false)
*/
private $titre = '';
/**
* @var string
*
* @ORM\Column(name="texte_court", type="text", length=65535, nullable=false)
*/
private $texteCourt = '';
/**
* @var string
*
* @ORM\Column(name="texte", type="text", length=65535, nullable=false)
*/
private $texte = '';
/**
* @var string
*
* @ORM\Column(name="mots_cles", type="string", length=500, nullable=false)
*/
private $motsCles = '';
/**
* @var string
*
* @ORM\Column(name="auteur", type="string", length=100, nullable=false)
*/
private $auteur = '';
/**
* @var string
*
* @ORM\Column(name="auteur_lien", type="string", length=255, nullable=false)
*/
private $auteurLien = '';
/**
* @var \DateTime
*
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @var \DateTime
*
* @ORM\Column(name="date_debut", type="datetime", nullable=true)
*/
private $dateDebut;
/**
* @var \DateTime
*
* @ORM\Column(name="date_fin", type="datetime", nullable=true)
*/
private $dateFin;
/**
* @var int
*
* @ORM\Column(name="ordre", type="integer", nullable=false, options={"default":0})
*/
private $ordre = 0;
/**
* @var bool
*
* @ORM\Column(name="actif", type="boolean", nullable=false, options={"default":0})
*/
private $actif = 0;
/**
* @var int
*
* @ORM\Column(name="lectures", type="integer", nullable=false, options={"default":0})
*/
private $lectures = 0;
/**
* @var string
*
* @ORM\Column(name="langue", type="string", length=3, nullable=false)
*/
private $langue = '';
/**
* @var bool
*
* @ORM\Column(name="une", type="boolean", nullable=false, options={"default":0})
*/
private $une = 0;
/**
* @var string
*
* @ORM\Column(name="photo", type="string", length=255, nullable=false)
*/
private $photo = '';
/**
* @var string
*
* @ORM\Column(name="actualites_associees", type="string", length=100, nullable=false)
*/
private $actualitesAssociees = '';
/**
* @ORM\OneToMany(targetEntity="App\Entity\Actualites\ActualitesCom", mappedBy="actualite", cascade={"persist", "remove"}, orphanRemoval=true)
*/
private $commentaires;
/**
* @ORM\ManyToOne(targetEntity=Ecoles::class, inversedBy="actualites")
*/
private $ecole;
/**
* Actualites constructor.
*/
public function __construct()
{
$this->date = new \DateTime();
$this->commentaires = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitreUrl(): ?string
{
return $this->titreUrl;
}
public function setTitreUrl(string $titreUrl): self
{
$this->titreUrl = $titreUrl;
return $this;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getTexteCourt(): ?string
{
return $this->texteCourt;
}
public function setTexteCourt(string $texteCourt): self
{
$this->texteCourt = $texteCourt;
return $this;
}
public function getTexte(): ?string
{
return $this->texte;
}
public function setTexte(string $texte): self
{
$this->texte = $texte;
return $this;
}
public function getMotsCles(): ?string
{
return $this->motsCles;
}
public function setMotsCles(string $motsCles): self
{
$this->motsCles = $motsCles;
return $this;
}
public function getAuteur(): ?string
{
return $this->auteur;
}
public function setAuteur(string $auteur): self
{
$this->auteur = $auteur;
return $this;
}
public function getAuteurLien(): ?string
{
return $this->auteurLien;
}
public function setAuteurLien(string $auteurLien): self
{
$this->auteurLien = $auteurLien;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getDateDebut(): ?\DateTimeInterface
{
return $this->dateDebut;
}
public function setDateDebut(? \DateTimeInterface $dateDebut): self
{
$this->dateDebut = $dateDebut;
return $this;
}
public function getDateFin(): ?\DateTimeInterface
{
return $this->dateFin;
}
public function setDateFin(? \DateTimeInterface $dateFin): self
{
$this->dateFin = $dateFin;
return $this;
}
public function getOrdre(): ?int
{
return $this->ordre;
}
public function setOrdre(int $ordre): self
{
$this->ordre = $ordre;
return $this;
}
public function getActif(): ?bool
{
return $this->actif;
}
public function setActif(bool $actif): self
{
$this->actif = $actif;
return $this;
}
public function getLectures(): ?int
{
return $this->lectures;
}
public function setLectures(int $lectures): self
{
$this->lectures = $lectures;
return $this;
}
public function getLangue(): ?string
{
return $this->langue;
}
public function setLangue(string $langue): self
{
$this->langue = $langue;
return $this;
}
public function getUne(): ?bool
{
return $this->une;
}
public function setUne(bool $une): self
{
$this->une = $une;
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(string $photo): self
{
$this->photo = $photo;
return $this;
}
public function getActualitesAssociees(): ?string
{
return $this->actualitesAssociees;
}
public function setActualitesAssociees(string $actualitesAssociees): self
{
$this->actualitesAssociees = $actualitesAssociees;
return $this;
}
public function getIdCat1(): ?ActualitesCat
{
return $this->idCat1;
}
public function setIdCat1(?ActualitesCat $idCat1): self
{
$this->idCat1 = $idCat1;
return $this;
}
public function getIdCat2(): ?ActualitesCat
{
return $this->idCat2;
}
public function setIdCat2(?ActualitesCat $idCat2): self
{
$this->idCat2 = $idCat2;
return $this;
}
/**
* @return Collection|ActualitesCom[]
*/
public function getCommentaires(): Collection
{
return $this->commentaires;
}
public function addCommentaire(ActualitesCom $commentaire): self
{
if (!$this->commentaires->contains($commentaire)) {
$this->commentaires[] = $commentaire;
$commentaire->setActualite($this);
}
return $this;
}
public function removeCommentaire(ActualitesCom $commentaire): self
{
if ($this->commentaires->contains($commentaire)) {
$this->commentaires->removeElement($commentaire);
// set the owning side to null (unless already changed)
if ($commentaire->getActualite() === $this) {
$commentaire->setActualite(null);
}
}
return $this;
}
public function getEcole(): ?Ecoles
{
return $this->ecole;
}
public function setEcole(?Ecoles $ecole): self
{
$this->ecole = $ecole;
return $this;
}
}