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", inversedBy="users", cascade={"persist"}, fetch="EAGER")
  53. * @ORM\JoinColumn(name="default_contact", referencedColumnName="id")
  54. */
  55. private $defaultContact;
  56. /**
  57. * @ORM\Column(type="json")
  58. */
  59. private $settings = [];
  60. public function getId(): ?int
  61. {
  62. return $this->id;
  63. }
  64. /**
  65. * @param mixed $id
  66. */
  67. public function setId($id): void
  68. {
  69. $this->id = $id;
  70. }
  71. public function getTitle(): ?string
  72. {
  73. return $this->title;
  74. }
  75. public function setTitle(string $title): self
  76. {
  77. $this->title = $title;
  78. return $this;
  79. }
  80. public function getLogo(): ?string
  81. {
  82. return $this->logo;
  83. }
  84. public function setLogo(?string $logo): self
  85. {
  86. $this->logo = $logo;
  87. return $this;
  88. }
  89. public function getTheme(): ?string
  90. {
  91. return $this->theme;
  92. }
  93. public function setTheme(string $theme): self
  94. {
  95. $this->theme = $theme;
  96. return $this;
  97. }
  98. /**
  99. * @return mixed
  100. */
  101. public function getOrderConfirmationRecipients()
  102. {
  103. return $this->orderConfirmationRecipients;
  104. }
  105. /**
  106. * @param mixed $orderConfirmationRecipients
  107. */
  108. public function setOrderConfirmationRecipients($orderConfirmationRecipients): void
  109. {
  110. $this->orderConfirmationRecipients = $orderConfirmationRecipients;
  111. }
  112. /**
  113. * @return string
  114. */
  115. public function getWebsite()
  116. {
  117. return $this->website;
  118. }
  119. /**
  120. * @param string $website
  121. */
  122. public function setWebsite(string $website): void
  123. {
  124. $this->website = $website;
  125. }
  126. /**
  127. * @return string
  128. */
  129. public function getAddress()
  130. {
  131. return $this->address;
  132. }
  133. /**
  134. * @param string $address
  135. */
  136. public function setAddress(string $address): void
  137. {
  138. $this->address = $address;
  139. }
  140. /**
  141. * @return mixed
  142. */
  143. public function getCompany()
  144. {
  145. return $this->company;
  146. }
  147. /**
  148. * @param mixed $company
  149. */
  150. public function setCompany($company): void
  151. {
  152. $this->company = $company;
  153. }
  154. /**
  155. * @return mixed
  156. */
  157. public function getDefaultContact()
  158. {
  159. return $this->defaultContact;
  160. }
  161. /**
  162. * @param mixed $defaultContact
  163. */
  164. public function setDefaultContact($defaultContact): void
  165. {
  166. $this->defaultContact = $defaultContact;
  167. }
  168. public function getSettings(): array
  169. {
  170. return (array) $this->settings;
  171. }
  172. public function setSettings(array $settings): void
  173. {
  174. $this->settings = $settings;
  175. }
  176. public function hasSetting($name): bool
  177. {
  178. return !!$this->getSetting($name);
  179. }
  180. public function getSetting($name): mixed
  181. {
  182. return $this->getSettingsAccessor()->getValue($this->getSettings(), $name);
  183. }
  184. public function getSettingsAccessor()
  185. {
  186. return PropertyAccess::createPropertyAccessor();
  187. }
  188. }