src/Entity/PolitiqueDepartementale.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PolitiqueDepartementaleRepository;
  4. use DateTime;
  5. use DateTimeInterface;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  11. /**
  12.  * @Vich\Uploadable
  13.  */
  14. #[ORM\Entity(repositoryClassPolitiqueDepartementaleRepository::class)]
  15. class PolitiqueDepartementale implements \Stringable
  16. {
  17.   #[ORM\Id]
  18.   #[ORM\GeneratedValue]
  19.   #[ORM\Column(type'integer')]
  20.   private ?int $id 0;
  21.   #[ORM\Column(type'string'length255nullabletrue)]
  22.   private ?string $titre null;
  23.   #[ORM\Column(type'string'length255nullabletrue)]
  24.   private ?string $pictogramme null;
  25.   /**
  26.    * @Vich\UploadableField(mapping="url_icon_images", fileNameProperty="pictogramme")
  27.    */
  28.   private ?File $urlIconFile null;
  29.   #[ORM\Column(type'string'length255nullabletrue)]
  30.   private ?string $alias_url null;
  31.   #[ORM\Column(type'boolean')]
  32.   private bool $sommaire_affiche;
  33.   #[ORM\Column(type'datetime'nullabletrue)]
  34.   private mixed $date_update;
  35.   #[ORM\Column(type'text'nullabletrue)]
  36.   private ?string $content null;
  37.   #[ORM\ManyToMany(targetEntityService::class, inversedBy'politiqueDepartementales')]
  38.   private mixed $services;
  39.   #[ORM\ManyToMany(targetEntityDocument::class, inversedBy'politiqueDepartementales')]
  40.   private mixed $documents;
  41.   #[ORM\ManyToMany(targetEntityContact::class, inversedBy'politiqueDepartementales')]
  42.   private mixed $contacts;
  43.   #[ORM\ManyToOne(targetEntityRssArticle::class, inversedBy'politiqueDepartementales')]
  44.   private mixed $nordinfo_rss;
  45.   #[ORM\Column(type'integer'nullabletrue)]
  46.   private ?int $ordre;
  47.   #[ORM\ManyToOne(targetEntityStatut::class, inversedBy'politiqueDepartementales')]
  48.   private mixed $statut;
  49.   #[ORM\Column(type'text'nullabletrue)]
  50.   private ?string $chapo null;
  51.   #[ORM\ManyToMany(targetEntityEpingle::class, mappedBy'visible_politiques')]
  52.   private mixed $epingles;
  53.   public function __construct()
  54.   {
  55.     $this->services = new ArrayCollection();
  56.     $this->documents = new ArrayCollection();
  57.     $this->contacts = new ArrayCollection();
  58.     $this->epingles = new ArrayCollection();
  59.   }
  60.   public function getId(): ?int
  61.   {
  62.     return $this->id;
  63.   }
  64.   public function getDateUpdate(): ?DateTimeInterface
  65.   {
  66.     return $this->date_update;
  67.   }
  68.   public function setDateUpdate(?DateTimeInterface $date_update): self
  69.   {
  70.     $this->date_update $date_update;
  71.     return $this;
  72.   }
  73.   public function getTitre(): ?string
  74.   {
  75.     return $this->titre;
  76.   }
  77.   public function setTitre(?string $titre): self
  78.   {
  79.     $this->titre $titre;
  80.     return $this;
  81.   }
  82.   public function getPictogramme(): ?string
  83.   {
  84.     return $this->pictogramme;
  85.   }
  86.   public function setPictogramme(?string $pictogramme): self
  87.   {
  88.     $this->pictogramme $pictogramme;
  89.     return $this;
  90.   }
  91.   public function setUrlIconFile(?File $urlIconFile null): void
  92.   {
  93.     $this->urlIconFile $urlIconFile;
  94.     
  95.     if ($urlIconFile) {
  96.       $this->date_update = new DateTime('now');
  97.     }
  98.   }
  99.   public function getUrlIconFile(): ?File
  100.   {
  101.     return $this->urlIconFile;
  102.   }
  103.   public function getAliasUrl(): ?string
  104.   {
  105.     return $this->alias_url;
  106.   }
  107.   public function setAliasUrl(?string $alias_url): self
  108.   {
  109.     $this->alias_url $alias_url;
  110.     return $this;
  111.   }
  112.   public function getSommaireAffiche(): ?bool
  113.   {
  114.     return $this->sommaire_affiche;
  115.   }
  116.   public function setSommaireAffiche(bool $sommaire_affiche): self
  117.   {
  118.     $this->sommaire_affiche $sommaire_affiche;
  119.     return $this;
  120.   }
  121.   public function getContent(): ?string
  122.   {
  123.     return $this->content;
  124.   }
  125.   public function setContent(?string $content): self
  126.   {
  127.     $this->content $content;
  128.     return $this;
  129.   }
  130.   /**
  131.    * @return Collection|Service[]
  132.    */
  133.   public function getServices(): Collection
  134.   {
  135.     return $this->services;
  136.   }
  137.   public function addService(Service $service): self
  138.   {
  139.     if (!$this->services->contains($service)) {
  140.       $this->services[] = $service;
  141.     }
  142.     return $this;
  143.   }
  144.   public function removeService(Service $service): self
  145.   {
  146.     $this->services->removeElement($service);
  147.     return $this;
  148.   }
  149.   /**
  150.    * @return Collection|Document[]
  151.    */
  152.   public function getDocuments(): Collection
  153.   {
  154.     return $this->documents;
  155.   }
  156.   public function addDocument(Document $document): self
  157.   {
  158.     if (!$this->documents->contains($document)) {
  159.       $this->documents[] = $document;
  160.     }
  161.     return $this;
  162.   }
  163.   public function removeDocument(Document $document): self
  164.   {
  165.     $this->documents->removeElement($document);
  166.     return $this;
  167.   }
  168.   /**
  169.    * @return Collection|Contact[]
  170.    */
  171.   public function getContacts(): Collection
  172.   {
  173.     return $this->contacts;
  174.   }
  175.   public function addContact(Contact $contact): self
  176.   {
  177.     if (!$this->contacts->contains($contact)) {
  178.       $this->contacts[] = $contact;
  179.     }
  180.     return $this;
  181.   }
  182.   public function removeContact(Contact $contact): self
  183.   {
  184.     $this->contacts->removeElement($contact);
  185.     return $this;
  186.   }
  187.   public function getNordinfoRss(): ?RssArticle
  188.   {
  189.     return $this->nordinfo_rss;
  190.   }
  191.   public function setNordinfoRss(?RssArticle $nordinfo_rss): self
  192.   {
  193.     $this->nordinfo_rss $nordinfo_rss;
  194.     return $this;
  195.   }
  196.   public function getOrdre(): ?int
  197.   {
  198.     return $this->ordre;
  199.   }
  200.   public function setOrdre(?int $ordre): self
  201.   {
  202.     $this->ordre $ordre;
  203.     return $this;
  204.   }
  205.   public function __toString(): string
  206.   {
  207.     return (string)$this->titre;
  208.   }
  209.   public function getStatut(): ?Statut
  210.   {
  211.     return $this->statut;
  212.   }
  213.   public function setStatut(?Statut $statut): self
  214.   {
  215.     $this->statut $statut;
  216.     return $this;
  217.   }
  218.   public function getChapo(): ?string
  219.   {
  220.     return $this->chapo;
  221.   }
  222.   public function setChapo(?string $chapo): self
  223.   {
  224.     $this->chapo $chapo;
  225.     return $this;
  226.   }
  227.   /**
  228.    * @return Collection|Epingle[]
  229.    */
  230.   public function getEpingles(): Collection
  231.   {
  232.     return $this->epingles;
  233.   }
  234.   public function addEpingle(Epingle $epingle): self
  235.   {
  236.     if (!$this->epingles->contains($epingle)) {
  237.       $this->epingles[] = $epingle;
  238.       $epingle->addVisiblePolitique($this);
  239.     }
  240.     return $this;
  241.   }
  242.   public function removeEpingle(Epingle $epingle): self
  243.   {
  244.     if ($this->epingles->removeElement($epingle)) {
  245.       $epingle->removeVisiblePolitique($this);
  246.     }
  247.     return $this;
  248.   }
  249. }