src/Entity/Dashboard.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\HttpFoundation\File\File;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. /**
  7.  * @ORM\Entity
  8.  * @Vich\Uploadable
  9.  */
  10. class Dashboard
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      *
  17.      * @var int
  18.      */
  19.     protected $id;
  20.     /**
  21.      * @ORM\Column(type="datetime", nullable=true)
  22.      *
  23.      * @var \DateTime
  24.      */
  25.     protected $updatedAt;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      *
  29.      * @var bool
  30.      */
  31.     protected $zone1Enabled;
  32.     /**
  33.      * @ORM\Column(type="string", nullable=true)
  34.      *
  35.      * @var string
  36.      */
  37.     protected $title1;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      *
  41.      * @var string
  42.      */
  43.     protected $text1;
  44.     /**
  45.      * @ORM\Column(type="string", nullable=true)
  46.      *
  47.      * @var string
  48.      */
  49.     protected $image1;
  50.     /**
  51.      * @Vich\UploadableField(mapping="dashboard", fileNameProperty="image1")
  52.      *
  53.      * @var File
  54.      */
  55.     protected $imageFile1;
  56.     /**
  57.      * @ORM\Column(type="boolean")
  58.      *
  59.      * @var bool
  60.      */
  61.     protected $eshopEnabled;
  62.     /**
  63.      * @ORM\Column(type="boolean")
  64.      *
  65.      * @var bool
  66.      */
  67.     protected $zone2Enabled;
  68.     /**
  69.      * @ORM\Column(type="string", nullable=true)
  70.      *
  71.      * @var string
  72.      */
  73.     protected $title2;
  74.     /**
  75.      * @ORM\Column(type="text", nullable=true)
  76.      *
  77.      * @var string
  78.      */
  79.     protected $text2;
  80.     /**
  81.      * @ORM\Column(type="string", nullable=true)
  82.      *
  83.      * @var string
  84.      */
  85.     protected $image2;
  86.     /**
  87.      * @Vich\UploadableField(mapping="dashboard", fileNameProperty="image2")
  88.      *
  89.      * @var File
  90.      */
  91.     protected $imageFile2;
  92.     /**
  93.      * @ORM\Column(type="boolean", options={"default": false})
  94.      *
  95.      * @var bool
  96.      */
  97.     protected $zone3Enabled false;
  98.     /**
  99.      * @ORM\Column(type="string", nullable=true)
  100.      *
  101.      * @var string
  102.      */
  103.     protected $title3;
  104.     /**
  105.      * @ORM\Column(type="text", nullable=true)
  106.      *
  107.      * @var string
  108.      */
  109.     protected $text3;
  110.     /**
  111.      * @ORM\Column(type="string", nullable=true)
  112.      *
  113.      * @var string
  114.      */
  115.     protected $image3;
  116.     /**
  117.      * @Vich\UploadableField(mapping="dashboard", fileNameProperty="image3")
  118.      *
  119.      * @var File
  120.      */
  121.     protected $imageFile3;
  122.     public function getId(): int
  123.     {
  124.         return $this->id;
  125.     }
  126.     /**
  127.      * @return Dashboard
  128.      */
  129.     public function setId(int $id): self
  130.     {
  131.         $this->id $id;
  132.         return $this;
  133.     }
  134.     public function isZone1Enabled(): bool
  135.     {
  136.         return $this->zone1Enabled;
  137.     }
  138.     /**
  139.      * @return Dashboard
  140.      */
  141.     public function setZone1Enabled(bool $zone1Enabled): self
  142.     {
  143.         $this->zone1Enabled $zone1Enabled;
  144.         return $this;
  145.     }
  146.     public function getTitle1(): ?string
  147.     {
  148.         return $this->title1;
  149.     }
  150.     /**
  151.      * @return Dashboard
  152.      */
  153.     public function setTitle1(?string $title1): self
  154.     {
  155.         $this->title1 $title1;
  156.         return $this;
  157.     }
  158.     public function getText1(): ?string
  159.     {
  160.         return $this->text1;
  161.     }
  162.     /**
  163.      * @return Dashboard
  164.      */
  165.     public function setText1(?string $text1): self
  166.     {
  167.         $this->text1 $text1;
  168.         return $this;
  169.     }
  170.     public function getImage1(): ?string
  171.     {
  172.         return $this->image1;
  173.     }
  174.     /**
  175.      * @return Dashboard
  176.      */
  177.     public function setImage1(?string $image1): self
  178.     {
  179.         $this->image1 $image1;
  180.         return $this;
  181.     }
  182.     public function getImageFile1(): ?File
  183.     {
  184.         return $this->imageFile1;
  185.     }
  186.     /**
  187.      * @throws \Exception
  188.      *
  189.      * @return Dashboard
  190.      */
  191.     public function setImageFile1(?File $imageFile1): self
  192.     {
  193.         $this->imageFile1 $imageFile1;
  194.         if ($imageFile1) {
  195.             $this->updatedAt = new \DateTime('now');
  196.         }
  197.         return $this;
  198.     }
  199.     public function isEshopEnabled(): bool
  200.     {
  201.         return $this->eshopEnabled;
  202.     }
  203.     /**
  204.      * @return Dashboard
  205.      */
  206.     public function setEshopEnabled(bool $eshopEnabled): self
  207.     {
  208.         $this->eshopEnabled $eshopEnabled;
  209.         return $this;
  210.     }
  211.     public function isZone2Enabled(): bool
  212.     {
  213.         return $this->zone2Enabled;
  214.     }
  215.     /**
  216.      * @return Dashboard
  217.      */
  218.     public function setZone2Enabled(bool $zone2Enabled): self
  219.     {
  220.         $this->zone2Enabled $zone2Enabled;
  221.         return $this;
  222.     }
  223.     public function getTitle2(): ?string
  224.     {
  225.         return $this->title2;
  226.     }
  227.     /**
  228.      * @return Dashboard
  229.      */
  230.     public function setTitle2(?string $title2): self
  231.     {
  232.         $this->title2 $title2;
  233.         return $this;
  234.     }
  235.     public function getText2(): ?string
  236.     {
  237.         return $this->text2;
  238.     }
  239.     /**
  240.      * @return Dashboard
  241.      */
  242.     public function setText2(?string $text2): self
  243.     {
  244.         $this->text2 $text2;
  245.         return $this;
  246.     }
  247.     public function getImage2(): ?string
  248.     {
  249.         return $this->image2;
  250.     }
  251.     /**
  252.      * @return Dashboard
  253.      */
  254.     public function setImage2(?string $image2): self
  255.     {
  256.         $this->image2 $image2;
  257.         return $this;
  258.     }
  259.     public function getImageFile2(): ?File
  260.     {
  261.         return $this->imageFile2;
  262.     }
  263.     /**
  264.      * @throws \Exception
  265.      *
  266.      * @return Dashboard
  267.      */
  268.     public function setImageFile2(?File $imageFile2): self
  269.     {
  270.         $this->imageFile2 $imageFile2;
  271.         if ($imageFile2) {
  272.             $this->updatedAt = new \DateTime('now');
  273.         }
  274.         return $this;
  275.     }
  276.     public function isZone3Enabled(): bool
  277.     {
  278.         return $this->zone3Enabled;
  279.     }
  280.     public function setZone3Enabled(bool $zone3Enabled): self
  281.     {
  282.         $this->zone3Enabled $zone3Enabled;
  283.         return $this;
  284.     }
  285.     public function getTitle3(): string
  286.     {
  287.         return $this->title3;
  288.     }
  289.     public function setTitle3(?string $title3): self
  290.     {
  291.         $this->title3 $title3;
  292.         return $this;
  293.     }
  294.     public function getText3(): string
  295.     {
  296.         return $this->text3;
  297.     }
  298.     public function setText3(?string $text3): self
  299.     {
  300.         $this->text3 $text3;
  301.         return $this;
  302.     }
  303.     public function getImage3(): ?string
  304.     {
  305.         return $this->image3;
  306.     }
  307.     public function setImage3(?string $image3): self
  308.     {
  309.         $this->image3 $image3;
  310.         return $this;
  311.     }
  312.     public function getImageFile3(): ?File
  313.     {
  314.         return $this->imageFile3;
  315.     }
  316.     public function setImageFile3(?File $imageFile3): self
  317.     {
  318.         $this->imageFile3 $imageFile3;
  319.         if ($imageFile3) {
  320.             $this->updatedAt = new \DateTime('now');
  321.         }
  322.         return $this;
  323.     }
  324.     public function getProTipsZone(): array
  325.     {
  326.         return [
  327.             'enabled' => $this->zone3Enabled,
  328.             'title'   => $this->title3,
  329.             'text'    => $this->text3,
  330.             'image'   => $this->image3,
  331.         ];
  332.     }
  333. }