src/Entity/SiteConfig.php line 19

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