vendor/roothirsch/core-bundle/Site/Entity/Site.php line 16

Open in your IDE?
  1. <?php
  2. namespace Roothirsch\CoreBundle\Site\Entity;
  3. use Roothirsch\CoreBundle\Entity\ContactPerson;
  4. use Roothirsch\CoreBundle\Entity\Traits\TimetrackedTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Symfony\Component\PropertyAccess\PropertyAccess;
  8. use Symfony\Component\PropertyAccess\PropertyAccessor;
  9. /**
  10. * @ORM\Entity
  11. * @ORM\Table(name="site")
  12. */
  13. class Site
  14. {
  15. use TimetrackedTrait;
  16. /**
  17. * @ORM\Id
  18. * @ORM\GeneratedValue
  19. * @ORM\Column(type="integer")
  20. */
  21. private $id;
  22. /**
  23. * @ORM\Column(type="string", length=1024)
  24. * @Gedmo\Translatable
  25. */
  26. private $title;
  27. /**
  28. * @ORM\Column(type="string", length=1024, nullable=true)
  29. */
  30. private $logo;
  31. /**
  32. * @ORM\Column(type="string", length=255)
  33. */
  34. private $theme;
  35. /**
  36. * @ORM\Column(type="string", length=1024)
  37. */
  38. private $orderConfirmationRecipients;
  39. /**
  40. * @ORM\Column(type="string", length=1024, nullable=true)
  41. */
  42. private $website;
  43. /**
  44. * @ORM\Column(type="string", length=1024, nullable=true)
  45. */
  46. private $address;
  47. /**
  48. * @ORM\Column(type="string", length=1024)
  49. */
  50. private $company = '';
  51. /**
  52. * @ORM\ManyToOne(targetEntity="Roothirsch\CoreBundle\Entity\ContactPerson", cascade={"persist"}, fetch="EAGER")
  53. * @ORM\JoinColumn(name="default_contact", referencedColumnName="id")
  54. */
  55. private $defaultContact;
  56. /**
  57. * @ORM\Column(type="boolean", options={"default"=false})
  58. */
  59. private $maintenanceEnabled = false;
  60. /**
  61. * @ORM\Column(type="string", length=1024, nullable=true)
  62. * @Gedmo\Translatable
  63. */
  64. private $maintenanceMessage;
  65. /**
  66. * @ORM\Column(type="json")
  67. */
  68. private $settings = [];
  69. public function getId(): ?int
  70. {
  71. return $this->id;
  72. }
  73. /**
  74. * @param mixed $id
  75. */
  76. public function setId($id): void
  77. {
  78. $this->id = $id;
  79. }
  80. public function getTitle(): ?string
  81. {
  82. return $this->title;
  83. }
  84. public function setTitle(string $title): self
  85. {
  86. $this->title = $title;
  87. return $this;
  88. }
  89. public function getLogo(): ?string
  90. {
  91. return $this->logo;
  92. }
  93. public function setLogo(?string $logo): self
  94. {
  95. $this->logo = $logo;
  96. return $this;
  97. }
  98. public function getTheme(): ?string
  99. {
  100. return $this->theme;
  101. }
  102. public function setTheme(string $theme): self
  103. {
  104. $this->theme = $theme;
  105. return $this;
  106. }
  107. /**
  108. * @return mixed
  109. */
  110. public function getOrderConfirmationRecipients()
  111. {
  112. return $this->orderConfirmationRecipients;
  113. }
  114. /**
  115. * @param mixed $orderConfirmationRecipients
  116. */
  117. public function setOrderConfirmationRecipients($orderConfirmationRecipients): void
  118. {
  119. $this->orderConfirmationRecipients = $orderConfirmationRecipients;
  120. }
  121. /**
  122. * @return string
  123. */
  124. public function getWebsite()
  125. {
  126. return $this->website;
  127. }
  128. /**
  129. * @param string $website
  130. */
  131. public function setWebsite(string $website): void
  132. {
  133. $this->website = $website;
  134. }
  135. /**
  136. * @return string
  137. */
  138. public function getAddress()
  139. {
  140. return $this->address;
  141. }
  142. /**
  143. * @param string $address
  144. */
  145. public function setAddress(string $address): void
  146. {
  147. $this->address = $address;
  148. }
  149. /**
  150. * @return mixed
  151. */
  152. public function getCompany()
  153. {
  154. return $this->company;
  155. }
  156. /**
  157. * @param mixed $company
  158. */
  159. public function setCompany($company): void
  160. {
  161. $this->company = $company;
  162. }
  163. /**
  164. * @return mixed
  165. */
  166. public function getDefaultContact()
  167. {
  168. return $this->defaultContact;
  169. }
  170. /**
  171. * @param mixed $defaultContact
  172. */
  173. public function setDefaultContact($defaultContact): void
  174. {
  175. $this->defaultContact = $defaultContact;
  176. }
  177. public function getSettings(): array
  178. {
  179. return (array) $this->settings;
  180. }
  181. public function setSettings(array $settings): void
  182. {
  183. $this->settings = $settings;
  184. }
  185. public function hasSetting($name): bool
  186. {
  187. return !!$this->getSetting($name);
  188. }
  189. public function getSetting($name): mixed
  190. {
  191. return $this->getSettingsAccessor()->getValue($this->getSettings(), $name);
  192. }
  193. public function getSettingsAccessor()
  194. {
  195. return PropertyAccess::createPropertyAccessor();
  196. }
  197. public function isMaintenanceEnabled(): bool
  198. {
  199. return $this->maintenanceEnabled;
  200. }
  201. public function setMaintenanceEnabled(bool $maintenanceEnabled): self
  202. {
  203. $this->maintenanceEnabled = $maintenanceEnabled;
  204. return $this;
  205. }
  206. public function getMaintenanceMessage(): ?string
  207. {
  208. return $this->maintenanceMessage;
  209. }
  210. public function setMaintenanceMessage(?string $maintenanceMessage): self
  211. {
  212. $this->maintenanceMessage = $maintenanceMessage;
  213. return $this;
  214. }
  215. }