src/Entity/SaquitoNoticia.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SaquitoNoticiaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SaquitoNoticiaRepository::class)
  9.  * @ORM\Table(name="saquitonoticias")
  10.  */
  11. class SaquitoNoticia
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="datetime")
  21.      */
  22.     private $fecha;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $copete;
  27.     /**
  28.      * @ORM\Column(type="string", length=150)
  29.      */
  30.     private $titulo;
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      */
  34.     private $slug;
  35.     /**
  36.      * @ORM\Column(type="integer", nullable=true)
  37.      */
  38.     private $visualizaciones;
  39.     /**
  40.      * @ORM\Column(type="string", length=50, nullable=true)
  41.      */
  42.     private $volanta;
  43.     /**
  44.      * @ORM\Column(type="text", nullable=true)
  45.      */
  46.     private $cuerpo;
  47.     /**
  48.      * @ORM\Column(type="boolean", nullable=true)
  49.      */
  50.     private $fotoportada;
  51.     /**
  52.      * @ORM\Column(type="boolean", nullable=true)
  53.      */
  54.     private $portada;
  55.     /**
  56.      * @ORM\Column(type="boolean", nullable=true)
  57.      */
  58.     private $destacada;
  59.     /**
  60.      * @ORM\Column(type="string", length=10, nullable=true)
  61.      */
  62.     private $idioma;
  63.     /**
  64.      * @ORM\Column(type="boolean", nullable=true)
  65.      */
  66.     private $privado;
  67.     /**
  68.      * @ORM\ManyToMany(targetEntity=SaquitoSeccion::class, inversedBy="noticias")
  69.      * @ORM\JoinTable(name="noticias_secciones",
  70.      *      joinColumns={@ORM\JoinColumn(name="noticias_id", referencedColumnName="id")},
  71.      *      inverseJoinColumns={@ORM\JoinColumn(name="secciones_id", referencedColumnName="id")}
  72.      *      )
  73.     */
  74.     private $secciones;
  75.     public function __construct()
  76.     {
  77.         $this->destacada false;
  78.         $this->portada false;
  79.         $this->privado false;
  80.         $this->fotoportada false;
  81.         $this->secciones = new ArrayCollection();
  82.     }
  83.     public function getId(): ?int
  84.     {
  85.         return $this->id;
  86.     }
  87.     public function getFecha(): ?\DateTimeInterface
  88.     {
  89.         return $this->fecha;
  90.     }
  91.     public function setFecha(\DateTimeInterface $fecha): self
  92.     {
  93.         $this->fecha $fecha;
  94.         return $this;
  95.     }
  96.     public function getCopete(): ?string
  97.     {
  98.         return $this->copete;
  99.     }
  100.     public function setCopete(string $copete): self
  101.     {
  102.         $this->copete $copete;
  103.         return $this;
  104.     }
  105.     public function getTitulo(): ?string
  106.     {
  107.         return $this->titulo;
  108.     }
  109.     public function setTitulo(string $titulo): self
  110.     {
  111.         $this->titulo $titulo;
  112.         return $this;
  113.     }
  114.     public function getSlug(): ?string
  115.     {
  116.         return $this->slug;
  117.     }
  118.     public function setSlug(string $slug): self
  119.     {
  120.         $this->slug $slug;
  121.         return $this;
  122.     }
  123.     public function getVisualizaciones(): ?int
  124.     {
  125.         return $this->visualizaciones;
  126.     }
  127.     public function setVisualizaciones(?int $visualizaciones): self
  128.     {
  129.         $this->visualizaciones $visualizaciones;
  130.         return $this;
  131.     }
  132.     public function getVolanta(): ?string
  133.     {
  134.         return $this->volanta;
  135.     }
  136.     public function setVolanta(?string $volanta): self
  137.     {
  138.         $this->volanta $volanta;
  139.         return $this;
  140.     }
  141.     public function getCuerpo(): ?string
  142.     {
  143.         return $this->cuerpo;
  144.     }
  145.     public function setCuerpo(?string $cuerpo): self
  146.     {
  147.         $this->cuerpo $cuerpo;
  148.         return $this;
  149.     }
  150.     public function isFotoportada(): ?bool
  151.     {
  152.         return $this->fotoportada;
  153.     }
  154.     public function setFotoportada(?bool $fotoportada): self
  155.     {
  156.         $this->fotoportada $fotoportada;
  157.         return $this;
  158.     }
  159.     public function isPortada(): ?bool
  160.     {
  161.         return $this->portada;
  162.     }
  163.     public function setPortada(?bool $portada): self
  164.     {
  165.         $this->portada $portada;
  166.         return $this;
  167.     }
  168.     public function isDestacada(): ?bool
  169.     {
  170.         return $this->destacada;
  171.     }
  172.     public function setDestacada(?bool $destacada): self
  173.     {
  174.         $this->destacada $destacada;
  175.         return $this;
  176.     }
  177.     public function getIdioma(): ?string
  178.     {
  179.         return $this->idioma;
  180.     }
  181.     public function setIdioma(?string $idioma): self
  182.     {
  183.         $this->idioma $idioma;
  184.         return $this;
  185.     }
  186.     public function isPrivado(): ?bool
  187.     {
  188.         return $this->privado;
  189.     }
  190.     public function setPrivado(?bool $privado): self
  191.     {
  192.         $this->privado $privado;
  193.         return $this;
  194.     }
  195.     /**
  196.      * @return Collection<int, SaquitoSeccion>
  197.      */
  198.     public function getSecciones(): Collection
  199.     {
  200.         return $this->secciones;
  201.     }
  202.     public function addSeccion(SaquitoSeccion $seccion): self
  203.     {
  204.         if (!$this->secciones->contains($seccion)) {
  205.             $this->secciones[] = $seccion;
  206.         }
  207.         return $this;
  208.     }
  209.     public function removeSeccione(SaquitoSeccion $seccion): self
  210.     {
  211.         $this->secciones->removeElement($seccion);
  212.         return $this;
  213.     }
  214.     public function __toString()
  215.     {
  216.         return $this->titulo ?? 'Noticia';
  217.     }        
  218.     
  219. }