<?php
namespace App\Entity;
use App\Repository\RssEventRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RssEventRepository::class)]
class RssEvent
{
#[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: 'rssEvents')]
private mixed $posts;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $motscles= null;
#[ORM\ManyToMany(targetEntity: Topic::class, inversedBy: 'rssEvents')]
private mixed $thematiques;
#[ORM\ManyToMany(targetEntity: Territory::class, inversedBy: 'rssEvents')]
private mixed $lieux;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $description= null;
#[ORM\JoinTable(name: 'rss_events_posts_exclus')]
#[ORM\ManyToMany(targetEntity: Post::class, inversedBy: 'rssEventsExclus')]
private mixed $posts_exclus;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $widget= null;
public function __construct()
{
$this->posts = new ArrayCollection();
$this->thematiques = new ArrayCollection();
$this->lieux = new ArrayCollection();
$this->posts_exclus = 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 getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
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;
}
public function getWidget(): ?string
{
return $this->widget;
}
public function setWidget(?string $widget): self
{
$this->widget = $widget;
return $this;
}
}