<?php
namespace Roothirsch\CoreBundle\Site\Entity;
use Roothirsch\CoreBundle\Entity\ContactPerson;
use Roothirsch\CoreBundle\Entity\Traits\TimetrackedTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessor;
/**
* @ORM\Entity
* @ORM\Table(name="site")
*/
class Site
{
use TimetrackedTrait;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=1024)
* @Gedmo\Translatable
*/
private $title;
/**
* @ORM\Column(type="string", length=1024, nullable=true)
*/
private $logo;
/**
* @ORM\Column(type="string", length=255)
*/
private $theme;
/**
* @ORM\Column(type="string", length=1024)
*/
private $orderConfirmationRecipients;
/**
* @ORM\Column(type="string", length=1024, nullable=true)
*/
private $website;
/**
* @ORM\Column(type="string", length=1024, nullable=true)
*/
private $address;
/**
* @ORM\Column(type="string", length=1024)
*/
private $company = '';
/**
* @ORM\ManyToOne(targetEntity="Roothirsch\CoreBundle\Entity\ContactPerson", inversedBy="users", cascade={"persist"}, fetch="EAGER")
* @ORM\JoinColumn(name="default_contact", referencedColumnName="id")
*/
private $defaultContact;
/**
* @ORM\Column(type="json")
*/
private $settings = [];
public function getId(): ?int
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id): void
{
$this->id = $id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function setLogo(?string $logo): self
{
$this->logo = $logo;
return $this;
}
public function getTheme(): ?string
{
return $this->theme;
}
public function setTheme(string $theme): self
{
$this->theme = $theme;
return $this;
}
/**
* @return mixed
*/
public function getOrderConfirmationRecipients()
{
return $this->orderConfirmationRecipients;
}
/**
* @param mixed $orderConfirmationRecipients
*/
public function setOrderConfirmationRecipients($orderConfirmationRecipients): void
{
$this->orderConfirmationRecipients = $orderConfirmationRecipients;
}
/**
* @return string
*/
public function getWebsite()
{
return $this->website;
}
/**
* @param string $website
*/
public function setWebsite(string $website): void
{
$this->website = $website;
}
/**
* @return string
*/
public function getAddress()
{
return $this->address;
}
/**
* @param string $address
*/
public function setAddress(string $address): void
{
$this->address = $address;
}
/**
* @return mixed
*/
public function getCompany()
{
return $this->company;
}
/**
* @param mixed $company
*/
public function setCompany($company): void
{
$this->company = $company;
}
/**
* @return mixed
*/
public function getDefaultContact()
{
return $this->defaultContact;
}
/**
* @param mixed $defaultContact
*/
public function setDefaultContact($defaultContact): void
{
$this->defaultContact = $defaultContact;
}
public function getSettings(): array
{
return (array) $this->settings;
}
public function setSettings(array $settings): void
{
$this->settings = $settings;
}
public function hasSetting($name): bool
{
return !!$this->getSetting($name);
}
public function getSetting($name): mixed
{
return $this->getSettingsAccessor()->getValue($this->getSettings(), $name);
}
public function getSettingsAccessor()
{
return PropertyAccess::createPropertyAccessor();
}
}