SiteInfos.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?php
  2. namespace Opentalent\OtAdmin\Domain\Entity;
  3. /**
  4. * Basic informations about a typo3 website
  5. */
  6. class SiteInfos
  7. {
  8. protected int $rootUid;
  9. protected string $siteTitle = "";
  10. protected string $baseUrl = "";
  11. protected string $template = "";
  12. protected string $preferences = "";
  13. protected ?int $matomoId = null;
  14. protected bool $deleted = false;
  15. protected bool $hiddenOrRestricted = false;
  16. protected array $mountedForBeUsers = [];
  17. /**
  18. * SiteInfos constructor.
  19. * @param int $rootUid
  20. * @param string|null $siteTitle
  21. * @param string|null $baseUrl
  22. * @param string|null $template
  23. * @param string|null $preferences
  24. * @param int|null $matomoId
  25. * @param bool $deleted
  26. * @param bool $hiddenOrRestricted
  27. * @param array|null $mountedForBeUsers
  28. */
  29. public function __construct(
  30. int $rootUid,
  31. string $siteTitle = null,
  32. string $baseUrl = null,
  33. string $template = null,
  34. string $preferences = null,
  35. int $matomoId = null,
  36. bool $deleted = false,
  37. bool $hiddenOrRestricted = false,
  38. array $mountedForBeUsers = null
  39. )
  40. {
  41. $this->rootUid = $rootUid;
  42. if ($siteTitle !== null) {
  43. $this->siteTitle = $siteTitle;
  44. }
  45. if ($baseUrl !== null) {
  46. $this->baseUrl = $baseUrl;
  47. }
  48. if ($template !== null) {
  49. $this->template = $template;
  50. }
  51. if ($preferences !== null) {
  52. $this->preferences = $preferences;
  53. }
  54. if ($matomoId !== null) {
  55. $this->matomoId = $matomoId;
  56. }
  57. if ($deleted !== null) {
  58. $this->deleted = $deleted;
  59. }
  60. if ($hiddenOrRestricted !== null) {
  61. $this->hiddenOrRestricted = $hiddenOrRestricted;
  62. }
  63. if ($mountedForBeUsers !== null) {
  64. $this->mountedForBeUsers = $mountedForBeUsers;
  65. }
  66. }
  67. /**
  68. * @return int
  69. */
  70. public function getRootUid(): int
  71. {
  72. return $this->rootUid;
  73. }
  74. /**
  75. * @param int $rootUid
  76. */
  77. public function setRootUid(int $rootUid): void
  78. {
  79. $this->rootUid = $rootUid;
  80. }
  81. /**
  82. * @return string
  83. */
  84. public function getSiteTitle(): string
  85. {
  86. return $this->siteTitle;
  87. }
  88. /**
  89. * @param string $siteTitle
  90. */
  91. public function setSiteTitle(string $siteTitle): void
  92. {
  93. $this->siteTitle = $siteTitle;
  94. }
  95. /**
  96. * @return string
  97. */
  98. public function getBaseUrl(): string
  99. {
  100. return $this->baseUrl;
  101. }
  102. /**
  103. * @param string $baseUrl
  104. */
  105. public function setBaseUrl(string $baseUrl): void
  106. {
  107. $this->baseUrl = $baseUrl;
  108. }
  109. /**
  110. * @return string
  111. */
  112. public function getTemplate(): string
  113. {
  114. return $this->template;
  115. }
  116. /**
  117. * @param string $template
  118. */
  119. public function setTemplate(string $template): void
  120. {
  121. $this->template = $template;
  122. }
  123. /**
  124. * @return string
  125. */
  126. public function getPreferences(): string
  127. {
  128. return $this->preferences;
  129. }
  130. /**
  131. * @param string $preferences
  132. */
  133. public function setPreferences(string $preferences): void
  134. {
  135. $this->preferences = $preferences;
  136. }
  137. /**
  138. * @return int
  139. */
  140. public function getMatomoId(): ?int
  141. {
  142. return $this->matomoId;
  143. }
  144. /**
  145. * @param int|null $matomoId
  146. */
  147. public function setMatomoId(?int $matomoId): void
  148. {
  149. $this->matomoId = $matomoId;
  150. }
  151. /**
  152. * @return bool
  153. */
  154. public function isDeleted(): bool
  155. {
  156. return $this->deleted;
  157. }
  158. /**
  159. * @param bool $deleted
  160. */
  161. public function setDeleted(bool $deleted): void
  162. {
  163. $this->deleted = $deleted;
  164. }
  165. /**
  166. * @return bool
  167. */
  168. public function isHiddenOrRestricted(): bool
  169. {
  170. return $this->hiddenOrRestricted;
  171. }
  172. /**
  173. * @param bool $hiddenOrRestricted
  174. */
  175. public function setHiddenOrRestricted(bool $hiddenOrRestricted): void
  176. {
  177. $this->hiddenOrRestricted = $hiddenOrRestricted;
  178. }
  179. /**
  180. * @return array
  181. */
  182. public function getMountedForBeUsers(): array
  183. {
  184. return $this->mountedForBeUsers;
  185. }
  186. /**
  187. * @param array $mountedForBeUsers
  188. */
  189. public function setMountedForBeUsers(array $mountedForBeUsers): void
  190. {
  191. $this->mountedForBeUsers = $mountedForBeUsers;
  192. }
  193. /**
  194. * @param array $beUser
  195. */
  196. public function addMountedForBeUser(array $beUser): void
  197. {
  198. $this->mountedForBeUsers[] = $beUser;
  199. }
  200. }