src/Entity/SiteConfig.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SiteConfigRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  6. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. /**
  11.  * @ORM\Entity(repositoryClass=SiteConfigRepository::class)
  12.  * @Vich\Uploadable
  13.  */
  14. class SiteConfig
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="datetime", options={"default": "CURRENT_TIMESTAMP"})
  24.      */
  25.     private $updatedAt;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      */
  29.     private $maintenanceMode;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $contactEmail;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $adminEmail;
  38.     /**
  39.      * @ORM\Column(type="json", nullable=true)
  40.      */
  41.     private $postalAddress = [];
  42.     /**
  43.      * @ORM\Column(type="json", nullable=true)
  44.      */
  45.     private $phoneNumber = [];
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $logo;
  50.     /**
  51.      * @Assert\File(
  52.      *     maxSize = "2048k",
  53.      *     mimeTypes = {"image/jpeg", "image/png", "image/bmp", "image/svg+xml"},
  54.      * )
  55.      * @Vich\UploadableField(mapping="site_config", fileNameProperty="logo")
  56.      * @var File
  57.      */
  58.     private $logoFile;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private $favicon;
  63.     /**
  64.      * @Assert\File(
  65.      *     maxSize = "2048k",
  66.      *     mimeTypes = {"image/jpeg", "image/png", "image/ico"},
  67.      * )
  68.      * @Vich\UploadableField(mapping="site_config", fileNameProperty="favicon")
  69.      * @var File
  70.      */
  71.     private $faviconFile;
  72.     /**
  73.      * @ORM\Column(type="float", nullable=true)
  74.      */
  75.     private $locLat;
  76.     /**
  77.      * @ORM\Column(type="float", nullable=true)
  78.      */
  79.     private $locLon;
  80.     /**
  81.      * @ORM\Column(type="string", length=255, nullable=true)
  82.      */
  83.     private $siteName;
  84.     /**
  85.      * @ORM\OneToOne(targetEntity=SiteConfigMeta::class, cascade={"persist", "remove"})
  86.      */
  87.     private $meta;
  88.     /**
  89.      * @ORM\Column(type="boolean", options={"default": false})
  90.      */
  91.     private $isAccountProfile false;
  92.     /**
  93.      * @ORM\Column(type="boolean", options={"default": false})
  94.      */
  95.     private $IsSearchForm false;
  96.     /**
  97.      * @ORM\Column(type="boolean", options={"default": false})
  98.      */
  99.     private $isHamburgerMenu false;
  100.     /**
  101.      * @ORM\Column(type="boolean", options={"default": false})
  102.      */
  103.     private $enableNewsletter;
  104.     /**
  105.      * @ORM\Column(type="string", length=255)
  106.      */
  107.     private $copyright;
  108.     /**
  109.      * @ORM\Column(type="boolean", options={"default": false})
  110.      */
  111.     private $editSharedLink;
  112.     /**
  113.      * @ORM\Column(type="boolean", options={"default": false})
  114.      */
  115.     private $activedItmConnect;
  116.     /**
  117.      * @ORM\Column(type="boolean", options={"default": true})
  118.      */
  119.     private $activedViewPdf;
  120.     /**
  121.      * @ORM\Column(type="boolean", options={"default": true})
  122.      */
  123.     private $activedNotification;
  124.     /**
  125.      * @ORM\Column(type="boolean", options={"default": true})
  126.      */
  127.     private $activedContribution;
  128.     /**
  129.      * @ORM\Column(type="integer", nullable=true)
  130.      */
  131.     private $contactTemplateId;
  132.     /**
  133.      * @ORM\Column(type="integer", nullable=true)
  134.      */
  135.     private $contributionTemplateId;
  136.     /**
  137.      * @ORM\Column(type="integer", nullable=true)
  138.      */
  139.     private $blogPostLifeTimeDays;
  140.     /**
  141.      * @ORM\Column(type="boolean", options={"default": false})
  142.      */
  143.     private $blogPostLifeTime;
  144.     /**
  145.      * @ORM\Column(type="boolean", nullable=true)
  146.      */
  147.     private $isPublicFrontOffice;
  148.     /**
  149.      * @ORM\Column(type="boolean", options={"default": false})
  150.      */
  151.     private $isTrackingForced false;
  152.     public function getId(): ?int
  153.     {
  154.         return $this->id;
  155.     }
  156.     /**
  157.      * @return \DateTimeInterface|null
  158.      */
  159.     public function getUpdatedAt(): ?\DateTimeInterface
  160.     {
  161.         return $this->updatedAt;
  162.     }
  163.     /**
  164.      * @param \DateTimeInterface $updatedAt
  165.      * @return $this
  166.      */
  167.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  168.     {
  169.         $this->updatedAt $updatedAt;
  170.         return $this;
  171.     }
  172.     public function getMaintenanceMode(): ?bool
  173.     {
  174.         return $this->maintenanceMode;
  175.     }
  176.     public function setMaintenanceMode(bool $maintenanceMode): self
  177.     {
  178.         $this->maintenanceMode $maintenanceMode;
  179.         return $this;
  180.     }
  181.     public function getContactEmail(): ?string
  182.     {
  183.         return $this->contactEmail;
  184.     }
  185.     public function setContactEmail(string $contactEmail): self
  186.     {
  187.         $this->contactEmail $contactEmail;
  188.         return $this;
  189.     }
  190.     public function getAdminEmail(): ?string
  191.     {
  192.         return $this->adminEmail;
  193.     }
  194.     public function setAdminEmail(string $adminEmail): self
  195.     {
  196.         $this->adminEmail $adminEmail;
  197.         return $this;
  198.     }
  199.     public function getPostalAddress(): ?array
  200.     {
  201.         return $this->postalAddress;
  202.     }
  203.     public function setPostalAddress(?array $postalAddress): self
  204.     {
  205.         $this->postalAddress $postalAddress;
  206.         return $this;
  207.     }
  208.     public function getPhoneNumber(): ?array
  209.     {
  210.         return $this->phoneNumber;
  211.     }
  212.     public function setPhoneNumber(?array $phoneNumber): self
  213.     {
  214.         $this->phoneNumber $phoneNumber;
  215.         return $this;
  216.     }
  217.     public function getLogo(): ?string
  218.     {
  219.         return $this->logo;
  220.     }
  221.     public function setLogo(?string $logo): self
  222.     {
  223.         $this->logo $logo;
  224.         return $this;
  225.     }
  226.     /**
  227.      * @param File|null $image
  228.      */
  229.     public function setLogoFile(File $image null)
  230.     {
  231.         $this->logoFile $image;
  232.         // VERY IMPORTANT:
  233.         // It is required that at least one field changes if you are using Doctrine,
  234.         // otherwise the event listeners won't be called and the file is lost
  235.         if ($image) {
  236.             // if 'updatedAt' is not defined in your entity, use another property
  237.             $this->updatedAt = new \DateTime('now');
  238.         }
  239.     }
  240.     /**
  241.      * @return File
  242.      */
  243.     public function getLogoFile()
  244.     {
  245.         return $this->logoFile;
  246.     }
  247.     public function getLocLat(): ?float
  248.     {
  249.         return $this->locLat;
  250.     }
  251.     public function setLocLat(?float $locLat): self
  252.     {
  253.         $this->locLat $locLat;
  254.         return $this;
  255.     }
  256.     public function getLocLon(): ?float
  257.     {
  258.         return $this->locLon;
  259.     }
  260.     public function setLocLon(?float $locLon): self
  261.     {
  262.         $this->locLon $locLon;
  263.         return $this;
  264.     }
  265.     public function getSiteName(): ?string
  266.     {
  267.         return $this->siteName;
  268.     }
  269.     public function setSiteName(?string $siteName): self
  270.     {
  271.         $this->siteName $siteName;
  272.         return $this;
  273.     }
  274.     public function getFavicon(): ?string
  275.     {
  276.         return $this->favicon;
  277.     }
  278.     public function setFavicon(?string $favicon): self
  279.     {
  280.         $this->favicon $favicon;
  281.         return $this;
  282.     }
  283.     /**
  284.      * @param File|null $image
  285.      */
  286.     public function setFaviconFile(File $image null)
  287.     {
  288.         $this->faviconFile $image;
  289.         // VERY IMPORTANT:
  290.         // It is required that at least one field changes if you are using Doctrine,
  291.         // otherwise the event listeners won't be called and the file is lost
  292.         if ($image) {
  293.             // if 'updatedAt' is not defined in your entity, use another property
  294.             $this->updatedAt = new \DateTime('now');
  295.         }
  296.     }
  297.     /**
  298.      * @return File
  299.      */
  300.     public function getFaviconFile()
  301.     {
  302.         return $this->faviconFile;
  303.     }
  304.     public function getMeta(): ?SiteConfigMeta
  305.     {
  306.         return $this->meta;
  307.     }
  308.     public function setMeta(?SiteConfigMeta $meta): self
  309.     {
  310.         $this->meta $meta;
  311.         return $this;
  312.     }
  313.     public function getMetaAuthor(): ?string
  314.     {
  315.         return $this->getMeta() === NULL 'DEFAULT' $this->getMeta()->getAuthor();
  316.     }
  317.     public function getMetaDescription(): ?string
  318.     {
  319.         return $this->getMeta() === NULL 'DEFAULT' $this->getMeta()->getDescription();
  320.     }
  321.     public function isAccountProfile(): ?bool
  322.     {
  323.         return $this->isAccountProfile;
  324.     }
  325.     public function setIsAccountProfile(bool $isAccountProfile): self
  326.     {
  327.         $this->isAccountProfile $isAccountProfile;
  328.         return $this;
  329.     }
  330.     public function isIsSearchForm(): ?bool
  331.     {
  332.         return $this->IsSearchForm;
  333.     }
  334.     public function setIsSearchForm(bool $IsSearchForm): self
  335.     {
  336.         $this->IsSearchForm $IsSearchForm;
  337.         return $this;
  338.     }
  339.     public function isHamburgerMenu(): ?bool
  340.     {
  341.         return $this->isHamburgerMenu;
  342.     }
  343.     public function setIsHamburgerMenu(bool $isHamburgerMenu): self
  344.     {
  345.         $this->isHamburgerMenu $isHamburgerMenu;
  346.         return $this;
  347.     }
  348.     public function getEnableNewsletter(): ?bool
  349.     {
  350.         return $this->enableNewsletter;
  351.     }
  352.     public function setEnableNewsletter(bool $enableNewsletter): self
  353.     {
  354.         $this->enableNewsletter $enableNewsletter;
  355.         return $this;
  356.     }
  357.     public function getCopyright(): ?string
  358.     {
  359.         return $this->copyright;
  360.     }
  361.     public function setCopyright(string $copyright): self
  362.     {
  363.         $this->copyright $copyright;
  364.         return $this;
  365.     }
  366.     public function getEditSharedLink(): ?bool
  367.     {
  368.         return $this->editSharedLink;
  369.     }
  370.     public function setEditSharedLink(bool $editSharedLink): self
  371.     {
  372.         $this->editSharedLink $editSharedLink;
  373.         return $this;
  374.     }
  375.     public function getActivedItmConnect(): ?bool
  376.     {
  377.         return $this->activedItmConnect;
  378.     }
  379.     public function setActivedItmConnect(bool $activedItmConnect): self
  380.     {
  381.         $this->activedItmConnect $activedItmConnect;
  382.         return $this;
  383.     }
  384.     public function getActivedViewPdf(): ?bool
  385.     {
  386.         return $this->activedViewPdf;
  387.     }
  388.     public function setActivedViewPdf(bool $activedViewPdf): self
  389.     {
  390.         $this->activedViewPdf $activedViewPdf;
  391.         return $this;
  392.     }
  393.     public function getActivedNotification(): ?bool
  394.     {
  395.         return $this->activedNotification;
  396.     }
  397.     public function setActivedNotification(bool $activedNotification): self
  398.     {
  399.         $this->activedNotification $activedNotification;
  400.         return $this;
  401.     }
  402.     public function getActivedContribution(): ?bool
  403.     {
  404.         return $this->activedContribution;
  405.     }
  406.     public function setActivedContribution(bool $activedContribution): self
  407.     {
  408.         $this->activedContribution $activedContribution;
  409.         return $this;
  410.     }
  411.     public function getContactTemplateId(): ?int
  412.     {
  413.         return $this->contactTemplateId;
  414.     }
  415.     public function setContactTemplateId(?int $contactTemplateId): self
  416.     {
  417.         $this->contactTemplateId $contactTemplateId;
  418.         return $this;
  419.     }
  420.     public function getContributionTemplateId(): ?int
  421.     {
  422.         return $this->contributionTemplateId;
  423.     }
  424.     public function setContributionTemplateId(?int $contributionTemplateId): self
  425.     {
  426.         $this->contributionTemplateId $contributionTemplateId;
  427.         return $this;
  428.     }
  429.     public function getBlogPostLifeTimeDays(): ?int
  430.     {
  431.         return $this->blogPostLifeTimeDays;
  432.     }
  433.     public function setBlogPostLifeTimeDays(?int $blogPostLifeTimeDays): self
  434.     {
  435.         $this->blogPostLifeTimeDays $blogPostLifeTimeDays;
  436.         return $this;
  437.     }
  438.     public function isBlogPostLifeTime(): ?bool
  439.     {
  440.         return $this->blogPostLifeTime;
  441.     }
  442.     public function setBlogPostLifeTime(?bool $blogPostLifeTime): self
  443.     {
  444.         $this->blogPostLifeTime $blogPostLifeTime;
  445.         return $this;
  446.     }
  447.     public function isPublicFrontOffice(): ?bool
  448.     {
  449.         return $this->isPublicFrontOffice;
  450.     }
  451.     public function setIsPublicFrontOffice(?bool $isPublicFrontOffice): self
  452.     {
  453.         $this->isPublicFrontOffice $isPublicFrontOffice;
  454.         return $this;
  455.     }
  456.     public function getIsTrackingForced(): ?bool
  457.     {
  458.         return $this->isTrackingForced;
  459.     }
  460.     public function setisTrackingForced(?bool $isTrackingForced): self
  461.     {
  462.         $this->isTrackingForced $isTrackingForced;
  463.         return $this;
  464.     }
  465. }