src/Entity/Articles.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\ArticlesRepository")
  10.  */
  11. class Articles extends OSEntity
  12. {
  13.     public function __construct(){
  14.         parent::__construct();
  15.         $this->hasGeneratedPdf false;
  16.         $this->isVisible true;
  17.         $this->isDeleted false;
  18.     }
  19.     /**
  20.      * @var bool
  21.      *
  22.      * @ORM\Column(name="isOnFrontPage", type="boolean", nullable=true)
  23.      */
  24.     private $isOnFrontPage;
  25.     /**
  26.      * @var bool
  27.      *
  28.      * @ORM\Column(name="isVisible", type="boolean",nullable=true)
  29.      */
  30.     private $isVisible;
  31.     /**
  32.      * @ORM\Column(name="isDeleted", type="boolean",nullable=true)
  33.      */
  34.     private $isDeleted;
  35.     /**
  36.      * @ORM\Column(name="youtube", type="string", length=255, nullable=true)
  37.      */
  38.     private $youtube;
  39.     /**
  40.      * @ORM\Column(name="flickr", type="string", length=255, nullable=true)
  41.      */
  42.     private $flickr;
  43.     /**
  44.      * @ORM\Column(name="URL", type="string", length=255, nullable=true)
  45.      */
  46.     private $URL;
  47.     /**
  48.      * @ORM\Column(name="soundcloud", type="string", length=255, nullable=true)
  49.      */
  50.     private $soundcloud;
  51.     /**
  52.      * @ORM\ManyToOne(targetEntity="App\Entity\ArticlesCategories", inversedBy="articles", fetch="EAGER")
  53.      * @ORM\JoinColumn(nullable=true)
  54.      */
  55.     private $category;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity="App\Entity\ArticlesTypes",inversedBy="articles", fetch="EAGER")
  58.      * @ORM\JoinColumn(nullable=true)
  59.      */
  60.     private $type;
  61.     /**
  62.      * @ORM\OneToOne(targetEntity="App\Entity\Albums", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
  63.      * @ORM\JoinColumn(nullable=true)
  64.      */
  65.     private $album;
  66.     /**
  67.      * @ORM\OneToOne(targetEntity="App\Entity\Biblios", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
  68.      * @ORM\JoinColumn(nullable=true)
  69.      */
  70.     private $biblio;
  71.     /**
  72.      * @var bool
  73.      *
  74.      * @ORM\Column(name="hasGeneratedPdf", type="boolean", nullable=true)
  75.      */
  76.     private $hasGeneratedPdf;
  77.     /**
  78.      * @ORM\OneToOne(targetEntity="App\Entity\Picture", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
  79.      * @ORM\JoinColumn(nullable=true)
  80.      */
  81.     private $qrcode;
  82.     /**
  83.      * @ORM\OneToOne(targetEntity="App\Entity\File", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
  84.      * @ORM\JoinColumn(nullable=true)
  85.      */
  86.     private $generatedPdf;
  87.     public function getIsOnFrontPage(): ?bool
  88.     {
  89.         return $this->isOnFrontPage;
  90.     }
  91.     public function setIsOnFrontPage(?bool $isOnFrontPage): self
  92.     {
  93.         $this->isOnFrontPage $isOnFrontPage;
  94.         return $this;
  95.     }
  96.     public function getIsVisible(): ?bool
  97.     {
  98.         return $this->isVisible;
  99.     }
  100.     public function setIsVisible(?bool $isVisible): self
  101.     {
  102.         $this->isVisible $isVisible;
  103.         return $this;
  104.     }
  105.     public function getIsDeleted(): ?bool
  106.     {
  107.         return $this->isDeleted;
  108.     }
  109.     public function setIsDeleted(?bool $isDeleted): self
  110.     {
  111.         $this->isDeleted $isDeleted;
  112.         return $this;
  113.     }
  114.     public function getYoutube(): ?string
  115.     {
  116.         return $this->youtube;
  117.     }
  118.     public function setYoutube(?string $youtube): self
  119.     {
  120.         $this->youtube $youtube;
  121.         return $this;
  122.     }
  123.     public function getFlickr(): ?string
  124.     {
  125.         return $this->flickr;
  126.     }
  127.     public function setFlickr(?string $flickr): self
  128.     {
  129.         $this->flickr $flickr;
  130.         return $this;
  131.     }
  132.     public function getURL(): ?string
  133.     {
  134.         return $this->URL;
  135.     }
  136.     public function setURL(?string $URL): self
  137.     {
  138.         $this->URL $URL;
  139.         return $this;
  140.     }
  141.     public function getSoundcloud(): ?string
  142.     {
  143.         return $this->soundcloud;
  144.     }
  145.     public function setSoundcloud(?string $soundcloud): self
  146.     {
  147.         $this->soundcloud $soundcloud;
  148.         return $this;
  149.     }
  150.     public function getCategory(): ?ArticlesCategories
  151.     {
  152.         return $this->category;
  153.     }
  154.     public function setCategory(?ArticlesCategories $category): self
  155.     {
  156.         $this->category $category;
  157.         return $this;
  158.     }
  159.     public function getAlbum(): ?Albums
  160.     {
  161.         return $this->album;
  162.     }
  163.     public function setAlbum(?Albums $album): self
  164.     {
  165.         $this->album $album;
  166.         return $this;
  167.     }
  168.     public function getBiblio(): ?Biblios
  169.     {
  170.         return $this->biblio;
  171.     }
  172.     public function setBiblio(?Biblios $biblio): self
  173.     {
  174.         $this->biblio $biblio;
  175.         return $this;
  176.     }
  177.     public function getType(): ?ArticlesTypes
  178.     {
  179.         return $this->type;
  180.     }
  181.     public function setType(?ArticlesTypes $type): self
  182.     {
  183.         $this->type $type;
  184.         return $this;
  185.     }
  186.     public function isHasGeneratedPdf(): ?bool
  187.     {
  188.         return $this->hasGeneratedPdf;
  189.     }
  190.     public function setHasGeneratedPdf(?bool $hasGeneratedPdf): self
  191.     {
  192.         $this->hasGeneratedPdf $hasGeneratedPdf;
  193.         return $this;
  194.     }
  195.     public function isIsOnFrontPage(): ?bool
  196.     {
  197.         return $this->isOnFrontPage;
  198.     }
  199.     public function isIsVisible(): ?bool
  200.     {
  201.         return $this->isVisible;
  202.     }
  203.     public function isIsDeleted(): ?bool
  204.     {
  205.         return $this->isDeleted;
  206.     }
  207.     public function getQrcode(): ?Picture
  208.     {
  209.         return $this->qrcode;
  210.     }
  211.     public function setQrcode(?Picture $qrcode): self
  212.     {
  213.         if($qrcode->getTarget()){
  214.             $this->qrcode $qrcode;
  215.             $this->qrcode->setDir('upload/images/articles/');
  216.             $this->qrcode->setThumbnailDir('upload/thumbnails/articles/');
  217.         }
  218.         // $this->qrcode = $qrcode;
  219.         return $this;
  220.     }
  221.     public function getGeneratedPdf(): ?File
  222.     {
  223.         return $this->generatedPdf;
  224.     }
  225.     public function setGeneratedPdf(?File $generatedPdf): self
  226.     {
  227.         if($generatedPdf->getTarget()){
  228.             $this->generatedPdf $generatedPdf;
  229.             $this->generatedPdf->setDir('upload/files/articles');
  230.         }
  231.         // $this->generatedPdf = $generatedPdf;
  232.         return $this;
  233.     }
  234. }