<?php
namespace App\Entity;
use App\Repository\RssArticleRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RssArticleRepository::class)]
class RssArticle implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = 0;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $name= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $alias= null;
#[ORM\ManyToMany(targetEntity: Post::class, inversedBy: 'rssArticles')]
private mixed $posts;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $motscles= null;
#[ORM\ManyToMany(targetEntity: Topic::class, inversedBy: 'rssArticles')]
private mixed $thematiques;
#[ORM\ManyToMany(targetEntity: Territory::class, inversedBy: 'rssArticles')]
private mixed $lieux;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $video;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $description= null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $widget= null;
#[ORM\JoinTable(name: 'rss_article_posts_exclus')]
#[ORM\ManyToMany(targetEntity: Post::class, inversedBy: 'rssArticlesExclus')]
private mixed $posts_exclus;
#[ORM\OneToMany(targetEntity: PageAccueil::class, mappedBy: 'nordinfo_rss')]
private mixed $pageAccueils;
#[ORM\OneToMany(targetEntity: PolitiqueDepartementale::class, mappedBy: 'nordinfo_rss')]
private mixed $politiqueDepartementales;
#[ORM\OneToMany(targetEntity: PageAccueilService::class, mappedBy: 'url_rss_nordinfo')]
private mixed $pageAccueilServices;
#[ORM\OneToMany(targetEntity: Pages::class, mappedBy: 'nordinfo_rss')]
private mixed $pages;
#[ORM\OneToMany(mappedBy: 'nordinfo_rss', targetEntity: PageSatellite::class)]
private Collection $pageSatellites;
public function __construct()
{
$this->posts = new ArrayCollection();
$this->thematiques = new ArrayCollection();
$this->lieux = new ArrayCollection();
$this->posts_exclus = new ArrayCollection();
$this->pageAccueils = new ArrayCollection();
$this->politiqueDepartementales = new ArrayCollection();
$this->pageAccueilServices = new ArrayCollection();
$this->pages = new ArrayCollection();
$this->pageSatellites = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getAlias(): ?string
{
return $this->alias;
}
public function setAlias(?string $alias): self
{
$this->alias = $alias;
return $this;
}
/**
* @return Collection|Post[]
*/
public function getPosts(): Collection
{
return $this->posts;
}
public function addPost(Post $post): self
{
if (!$this->posts->contains($post)) {
$this->posts[] = $post;
}
return $this;
}
public function removePost(Post $post): self
{
if ($this->posts->contains($post)) {
$this->posts->removeElement($post);
}
return $this;
}
public function getMotscles(): ?string
{
return $this->motscles;
}
public function setMotscles(?string $motscles): self
{
$this->motscles = $motscles;
return $this;
}
/**
* @return Collection|Topic[]
*/
public function getThematiques(): Collection
{
return $this->thematiques;
}
public function addThematique(Topic $thematique): self
{
if (!$this->thematiques->contains($thematique)) {
$this->thematiques[] = $thematique;
}
return $this;
}
public function removeThematique(Topic $thematique): self
{
if ($this->thematiques->contains($thematique)) {
$this->thematiques->removeElement($thematique);
}
return $this;
}
/**
* @return Collection|Territory[]
*/
public function getLieux(): Collection
{
return $this->lieux;
}
public function addLieux(Territory $lieux): self
{
if (!$this->lieux->contains($lieux)) {
$this->lieux[] = $lieux;
}
return $this;
}
public function removeLieux(Territory $lieux): self
{
if ($this->lieux->contains($lieux)) {
$this->lieux->removeElement($lieux);
}
return $this;
}
public function getVideo(): ?bool
{
return $this->video;
}
public function setVideo(?bool $video): self
{
$this->video = $video;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getWidget(): ?string
{
return $this->widget;
}
public function setWidget(?string $widget): self
{
$this->widget = $widget;
return $this;
}
/**
* @return Collection|Post[]
*/
public function getPostsExclus(): Collection
{
return $this->posts_exclus;
}
public function addPostsExclu(Post $postsExclu): self
{
if (!$this->posts_exclus->contains($postsExclu)) {
$this->posts_exclus[] = $postsExclu;
}
return $this;
}
public function removePostsExclu(Post $postsExclu): self
{
$this->posts_exclus->removeElement($postsExclu);
return $this;
}
/**
* @return Collection|PageAccueil[]
*/
public function getPageAccueils(): Collection
{
return $this->pageAccueils;
}
public function addPageAccueil(PageAccueil $pageAccueil): self
{
if (!$this->pageAccueils->contains($pageAccueil)) {
$this->pageAccueils[] = $pageAccueil;
$pageAccueil->setNordinfoRss($this);
}
return $this;
}
public function removePageAccueil(PageAccueil $pageAccueil): self
{
if ($this->pageAccueils->removeElement($pageAccueil)) {
// set the owning side to null (unless already changed)
if ($pageAccueil->getNordinfoRss() === $this) {
$pageAccueil->setNordinfoRss(null);
}
}
return $this;
}
/**
* @return Collection|PolitiqueDepartementale[]
*/
public function getPolitiqueDepartementales(): Collection
{
return $this->politiqueDepartementales;
}
public function addPolitiqueDepartementale(PolitiqueDepartementale $politiqueDepartementale): self
{
if (!$this->politiqueDepartementales->contains($politiqueDepartementale)) {
$this->politiqueDepartementales[] = $politiqueDepartementale;
$politiqueDepartementale->setNordinfoRss($this);
}
return $this;
}
public function removePolitiqueDepartementale(PolitiqueDepartementale $politiqueDepartementale): self
{
if ($this->politiqueDepartementales->removeElement($politiqueDepartementale)) {
// set the owning side to null (unless already changed)
if ($politiqueDepartementale->getNordinfoRss() === $this) {
$politiqueDepartementale->setNordinfoRss(null);
}
}
return $this;
}
public function __toString(): string
{
return (string) $this->name;
}
/**
* @return Collection|PageAccueilService[]
*/
public function getPageAccueilServices(): Collection
{
return $this->pageAccueilServices;
}
public function addPageAccueilService(PageAccueilService $pageAccueilService): self
{
if (!$this->pageAccueilServices->contains($pageAccueilService)) {
$this->pageAccueilServices[] = $pageAccueilService;
$pageAccueilService->setUrlRssNordinfo($this);
}
return $this;
}
public function removePageAccueilService(PageAccueilService $pageAccueilService): self
{
if ($this->pageAccueilServices->removeElement($pageAccueilService)) {
// set the owning side to null (unless already changed)
if ($pageAccueilService->getUrlRssNordinfo() === $this) {
$pageAccueilService->setUrlRssNordinfo(null);
}
}
return $this;
}
/**
* @return Collection|Pages[]
*/
public function getPages(): Collection
{
return $this->pages;
}
public function addPage(Pages $page): self
{
if (!$this->pages->contains($page)) {
$this->pages[] = $page;
$page->setNordinfoRss($this);
}
return $this;
}
public function removePage(Pages $page): self
{
if ($this->pages->removeElement($page)) {
// set the owning side to null (unless already changed)
if ($page->getNordinfoRss() === $this) {
$page->setNordinfoRss(null);
}
}
return $this;
}
/**
* @return Collection<int, PageSatellite>
*/
public function getPageSatellites(): Collection
{
return $this->pageSatellites;
}
public function addPageSatellite(PageSatellite $pageSatellite): self
{
if (!$this->pageSatellites->contains($pageSatellite)) {
$this->pageSatellites->add($pageSatellite);
$pageSatellite->setNordinfoRss($this);
}
return $this;
}
public function removePageSatellite(PageSatellite $pageSatellite): self
{
if ($this->pageSatellites->removeElement($pageSatellite)) {
// set the owning side to null (unless already changed)
if ($pageSatellite->getNordinfoRss() === $this) {
$pageSatellite->setNordinfoRss(null);
}
}
return $this;
}
}