<?php
namespace App\Entity;
use App\Repository\SiteConfigRepository;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use App\Entity\Instance;
/**
* @ORM\Entity(repositoryClass=SiteConfigRepository::class)
* @Vich\Uploadable
*/
class SiteConfig
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime", options={"default": "CURRENT_TIMESTAMP"})
*/
private $updatedAt;
/**
* @ORM\Column(type="boolean")
*/
private $maintenanceMode;
/**
* @ORM\Column(type="string", length=255)
*/
private $contactEmail;
/**
* @ORM\Column(type="string", length=255)
*/
private $adminEmail;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $postalAddress = [];
/**
* @ORM\Column(type="json", nullable=true)
*/
private $phoneNumber = [];
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $logo;
/**
* @Assert\File(
* maxSize = "2048k",
* mimeTypes = {"image/jpeg", "image/png", "image/bmp", "image/svg+xml"},
* )
* @Vich\UploadableField(mapping="site_config", fileNameProperty="logo")
* @var File
*/
private $logoFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $favicon;
/**
* @Assert\File(
* maxSize = "2048k",
* mimeTypes = {"image/jpeg", "image/png", "image/ico"},
* )
* @Vich\UploadableField(mapping="site_config", fileNameProperty="favicon")
* @var File
*/
private $faviconFile;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $locLat;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $locLon;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $siteName;
/**
* @ORM\OneToOne(targetEntity=SiteConfigMeta::class, cascade={"persist", "remove"})
*/
private $meta;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $isAccountProfile = false;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $IsSearchForm = false;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $isHamburgerMenu = false;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $enableNewsletter;
/**
* @ORM\Column(type="string", length=255)
*/
private $copyright;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": false})
*/
private $editSharedLink;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": false})
*/
private $activedItmConnect;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": true})
*/
private $activedViewPdf;
/**
* @ORM\Column(type="boolean",nullable=true, options={"default": true})
*/
private $activedNotification;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default": true})
*/
private $activedContribution;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $contactTemplateId;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $contributionTemplateId;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $blogPostLifeTimeDays;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $blogPostLifeTime;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isPublicFrontOffice;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $isTrackingForced = false;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $isInstanceActive = false;
/**
* @ORM\ManyToOne(targetEntity=Instance::class, inversedBy="siteConfigs")
*/
private ?Instance $instance = null;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private bool $isIdentityActive = false;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private bool $isCockpitActive = false;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private bool $isAnonymizationActive = false;
public function __construct()
{
$this->meta = new SiteConfigMeta();
$this->updatedAt = new \DateTime();
$this->maintenanceMode = false;
$this->isAccountProfile = false;
$this->IsSearchForm = false;
$this->isHamburgerMenu = false;
$this->enableNewsletter = false;
$this->editSharedLink = false;
$this->activedItmConnect = false;
$this->activedViewPdf = true;
$this->activedNotification = true;
$this->activedContribution = true;
$this->isPublicFrontOffice = false;
$this->isTrackingForced = false;
$this->isInstanceActive = false;
$this->isIdentityActive = false;
$this->isCockpitActive = false;
$this->isAnonymizationActive = false;
$this->blogPostLifeTime = false;
$this->contactEmail = '';
$this->adminEmail = '';
$this->copyright = '';
$this->siteName = '';
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return \DateTimeInterface|null
*/
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
/**
* @param \DateTimeInterface $updatedAt
* @return $this
*/
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getMaintenanceMode(): ?bool
{
return $this->maintenanceMode;
}
public function setMaintenanceMode(bool $maintenanceMode): self
{
$this->maintenanceMode = $maintenanceMode;
return $this;
}
public function getContactEmail(): ?string
{
return $this->contactEmail;
}
public function setContactEmail(string $contactEmail): self
{
$this->contactEmail = $contactEmail;
return $this;
}
public function getAdminEmail(): ?string
{
return $this->adminEmail;
}
public function setAdminEmail(string $adminEmail): self
{
$this->adminEmail = $adminEmail;
return $this;
}
public function getPostalAddress(): ?array
{
return $this->postalAddress;
}
public function setPostalAddress(?array $postalAddress): self
{
$this->postalAddress = $postalAddress;
return $this;
}
public function getPhoneNumber(): ?array
{
return $this->phoneNumber;
}
public function setPhoneNumber(?array $phoneNumber): self
{
$this->phoneNumber = $phoneNumber;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function setLogo(?string $logo): self
{
$this->logo = $logo;
return $this;
}
/**
* @param File|null $image
*/
public function setLogoFile(File $image = null)
{
$this->logoFile = $image;
// VERY IMPORTANT:
// It is required that at least one field changes if you are using Doctrine,
// otherwise the event listeners won't be called and the file is lost
if ($image) {
// if 'updatedAt' is not defined in your entity, use another property
$this->updatedAt = new \DateTime('now');
}
}
/**
* @return File
*/
public function getLogoFile()
{
return $this->logoFile;
}
public function getLocLat(): ?float
{
return $this->locLat;
}
public function setLocLat(?float $locLat): self
{
$this->locLat = $locLat;
return $this;
}
public function getLocLon(): ?float
{
return $this->locLon;
}
public function setLocLon(?float $locLon): self
{
$this->locLon = $locLon;
return $this;
}
public function getSiteName(): ?string
{
return $this->siteName;
}
public function setSiteName(?string $siteName): self
{
$this->siteName = $siteName;
return $this;
}
public function getFavicon(): ?string
{
return $this->favicon;
}
public function setFavicon(?string $favicon): self
{
$this->favicon = $favicon;
return $this;
}
/**
* @param File|null $image
*/
public function setFaviconFile(File $image = null)
{
$this->faviconFile = $image;
// VERY IMPORTANT:
// It is required that at least one field changes if you are using Doctrine,
// otherwise the event listeners won't be called and the file is lost
if ($image) {
// if 'updatedAt' is not defined in your entity, use another property
$this->updatedAt = new \DateTime('now');
}
}
/**
* @return File
*/
public function getFaviconFile()
{
return $this->faviconFile;
}
public function getMeta(): ?SiteConfigMeta
{
return $this->meta;
}
public function setMeta(?SiteConfigMeta $meta): self
{
$this->meta = $meta;
return $this;
}
public function getMetaAuthor(): ?string
{
return $this->getMeta() === NULL ? 'DEFAULT' : $this->getMeta()->getAuthor();
}
public function getMetaDescription(): ?string
{
return $this->getMeta() === NULL ? 'DEFAULT' : $this->getMeta()->getDescription();
}
public function isAccountProfile(): ?bool
{
return $this->isAccountProfile;
}
public function setIsAccountProfile(bool $isAccountProfile): self
{
$this->isAccountProfile = $isAccountProfile;
return $this;
}
public function isIsSearchForm(): ?bool
{
return $this->IsSearchForm;
}
public function setIsSearchForm(bool $IsSearchForm): self
{
$this->IsSearchForm = $IsSearchForm;
return $this;
}
public function isHamburgerMenu(): ?bool
{
return $this->isHamburgerMenu;
}
public function setIsHamburgerMenu(bool $isHamburgerMenu): self
{
$this->isHamburgerMenu = $isHamburgerMenu;
return $this;
}
public function getEnableNewsletter(): ?bool
{
return $this->enableNewsletter;
}
public function setEnableNewsletter(bool $enableNewsletter): self
{
$this->enableNewsletter = $enableNewsletter;
return $this;
}
public function getCopyright(): ?string
{
return $this->copyright;
}
public function setCopyright(string $copyright): self
{
$this->copyright = $copyright;
return $this;
}
public function getEditSharedLink(): ?bool
{
return $this->editSharedLink;
}
public function setEditSharedLink(bool $editSharedLink): self
{
$this->editSharedLink = $editSharedLink;
return $this;
}
public function getActivedItmConnect(): ?bool
{
return $this->activedItmConnect;
}
public function setActivedItmConnect(bool $activedItmConnect): self
{
$this->activedItmConnect = $activedItmConnect;
return $this;
}
public function getActivedViewPdf(): ?bool
{
return $this->activedViewPdf;
}
public function setActivedViewPdf(bool $activedViewPdf): self
{
$this->activedViewPdf = $activedViewPdf;
return $this;
}
public function getActivedNotification(): ?bool
{
return $this->activedNotification;
}
public function setActivedNotification(bool $activedNotification): self
{
$this->activedNotification = $activedNotification;
return $this;
}
public function getActivedContribution(): ?bool
{
return $this->activedContribution;
}
public function setActivedContribution(bool $activedContribution): self
{
$this->activedContribution = $activedContribution;
return $this;
}
public function getContactTemplateId(): ?int
{
return $this->contactTemplateId;
}
public function setContactTemplateId(?int $contactTemplateId): self
{
$this->contactTemplateId = $contactTemplateId;
return $this;
}
public function getContributionTemplateId(): ?int
{
return $this->contributionTemplateId;
}
public function setContributionTemplateId(?int $contributionTemplateId): self
{
$this->contributionTemplateId = $contributionTemplateId;
return $this;
}
public function getBlogPostLifeTimeDays(): ?int
{
return $this->blogPostLifeTimeDays;
}
public function setBlogPostLifeTimeDays(?int $blogPostLifeTimeDays): self
{
$this->blogPostLifeTimeDays = $blogPostLifeTimeDays;
return $this;
}
public function isBlogPostLifeTime(): ?bool
{
return $this->blogPostLifeTime;
}
public function setBlogPostLifeTime(?bool $blogPostLifeTime): self
{
$this->blogPostLifeTime = $blogPostLifeTime;
return $this;
}
public function isPublicFrontOffice(): ?bool
{
return $this->isPublicFrontOffice;
}
public function setIsPublicFrontOffice(?bool $isPublicFrontOffice): self
{
$this->isPublicFrontOffice = $isPublicFrontOffice;
return $this;
}
public function getIsTrackingForced(): ?bool
{
return $this->isTrackingForced;
}
public function setisTrackingForced(?bool $isTrackingForced): self
{
$this->isTrackingForced = $isTrackingForced;
return $this;
}
public function isInstanceActive(): ?bool
{
return $this->isInstanceActive;
}
public function setIsInstanceActive(bool $isInstanceActive): self
{
$this->isInstanceActive = $isInstanceActive;
return $this;
}
public function getInstance(): ?Instance
{
return $this->instance;
}
public function setInstance(?Instance $instance): self
{
$this->instance = $instance;
return $this;
}
public function isIdentityActive(): bool
{
return (bool) $this->isIdentityActive;
}
public function setIsIdentityActive(bool $active): self
{
$this->isIdentityActive = $active;
return $this;
}
public function isCockpitActive(): bool
{
return (bool) $this->isCockpitActive;
}
public function setIsCockpitActive(bool $active): self
{
$this->isCockpitActive = $active;
return $this;
}
public function isAnonymizationActive(): bool
{
return (bool) $this->isAnonymizationActive;
}
public function setIsAnonymizationActive(bool $active): self
{
$this->isAnonymizationActive = $active;
return $this;
}
}