SiteInfos.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <?php
  2. namespace Opentalent\OtAdmin\Domain\Entity;
  3. /**
  4. * Basic information 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 $isPremium = null;
  15. protected bool $deleted = false;
  16. protected bool $hiddenOrRestricted = false;
  17. protected array $mountedForBeUsers = [];
  18. protected array $mountedForBeGroups = [];
  19. protected ?int $ownerUserUid = null;
  20. protected ?int $ownerGroupUid = null;
  21. /**
  22. * SiteInfos constructor.
  23. * @param int $rootUid
  24. * @param string|null $siteTitle
  25. * @param string|null $baseUrl
  26. * @param string|null $template
  27. * @param string|null $preferences
  28. * @param int|null $matomoId
  29. * @param bool|null $isPremium
  30. * @param bool $deleted
  31. * @param bool $hiddenOrRestricted
  32. * @param array|null $mountedForBeUsers
  33. * @param array|null $mountedForBeGroups
  34. * @param int|null $ownerUserUid
  35. * @param int|null $ownerGroupUid
  36. */
  37. public function __construct(
  38. int $rootUid,
  39. string $siteTitle = null,
  40. string $baseUrl = null,
  41. string $template = null,
  42. string $preferences = null,
  43. int $matomoId = null,
  44. bool $isPremium = null,
  45. bool $deleted = false,
  46. bool $hiddenOrRestricted = false,
  47. array $mountedForBeUsers = null,
  48. array $mountedForBeGroups = null,
  49. int $ownerUserUid = null,
  50. int $ownerGroupUid = null
  51. )
  52. {
  53. $this->rootUid = $rootUid;
  54. if ($siteTitle !== null) {
  55. $this->siteTitle = $siteTitle;
  56. }
  57. if ($baseUrl !== null) {
  58. $this->baseUrl = $baseUrl;
  59. }
  60. if ($template !== null) {
  61. $this->template = $template;
  62. }
  63. if ($preferences !== null) {
  64. $this->preferences = $preferences;
  65. }
  66. if ($matomoId !== null) {
  67. $this->matomoId = $matomoId;
  68. }
  69. if ($isPremium !== null) {
  70. $this->isPremium = $isPremium;
  71. }
  72. if ($deleted !== null) {
  73. $this->deleted = $deleted;
  74. }
  75. if ($hiddenOrRestricted !== null) {
  76. $this->hiddenOrRestricted = $hiddenOrRestricted;
  77. }
  78. if ($mountedForBeUsers !== null) {
  79. $this->mountedForBeUsers = $mountedForBeUsers;
  80. }
  81. if ($mountedForBeGroups !== null) {
  82. $this->mountedForBeGroups = $mountedForBeGroups;
  83. }
  84. if ($ownerUserUid !== null) {
  85. $this->ownerUserUid = $ownerUserUid;
  86. }
  87. if ($ownerGroupUid !== null) {
  88. $this->ownerGroupUid = $ownerGroupUid;
  89. }
  90. }
  91. /**
  92. * @return int
  93. */
  94. public function getRootUid(): int
  95. {
  96. return $this->rootUid;
  97. }
  98. /**
  99. * @param int $rootUid
  100. */
  101. public function setRootUid(int $rootUid): void
  102. {
  103. $this->rootUid = $rootUid;
  104. }
  105. /**
  106. * @return string
  107. */
  108. public function getSiteTitle(): string
  109. {
  110. return $this->siteTitle;
  111. }
  112. /**
  113. * @param string $siteTitle
  114. */
  115. public function setSiteTitle(string $siteTitle): void
  116. {
  117. $this->siteTitle = $siteTitle;
  118. }
  119. /**
  120. * @return string
  121. */
  122. public function getBaseUrl(): string
  123. {
  124. return $this->baseUrl;
  125. }
  126. /**
  127. * @param string $baseUrl
  128. */
  129. public function setBaseUrl(string $baseUrl): void
  130. {
  131. $this->baseUrl = $baseUrl;
  132. }
  133. /**
  134. * @return string
  135. */
  136. public function getTemplate(): string
  137. {
  138. return $this->template;
  139. }
  140. /**
  141. * @param string $template
  142. */
  143. public function setTemplate(string $template): void
  144. {
  145. $this->template = $template;
  146. }
  147. /**
  148. * @return string
  149. */
  150. public function getPreferences(): string
  151. {
  152. return $this->preferences;
  153. }
  154. /**
  155. * @param string $preferences
  156. */
  157. public function setPreferences(string $preferences): void
  158. {
  159. $this->preferences = $preferences;
  160. }
  161. /**
  162. * @return int
  163. */
  164. public function getMatomoId(): ?int
  165. {
  166. return $this->matomoId;
  167. }
  168. /**
  169. * @param int|null $matomoId
  170. */
  171. public function setMatomoId(?int $matomoId): void
  172. {
  173. $this->matomoId = $matomoId;
  174. }
  175. /**
  176. * @return bool | null
  177. */
  178. public function isPremium(): ?bool
  179. {
  180. return $this->isPremium;
  181. }
  182. /**
  183. * @param bool $isPremium
  184. */
  185. public function setIsPremium(bool $isPremium): void
  186. {
  187. $this->isPremium = $isPremium;
  188. }
  189. /**
  190. * @return bool
  191. */
  192. public function isDeleted(): bool
  193. {
  194. return $this->deleted;
  195. }
  196. /**
  197. * @param bool $deleted
  198. */
  199. public function setDeleted(bool $deleted): void
  200. {
  201. $this->deleted = $deleted;
  202. }
  203. /**
  204. * @return bool
  205. */
  206. public function isHiddenOrRestricted(): bool
  207. {
  208. return $this->hiddenOrRestricted;
  209. }
  210. /**
  211. * @param bool $hiddenOrRestricted
  212. */
  213. public function setHiddenOrRestricted(bool $hiddenOrRestricted): void
  214. {
  215. $this->hiddenOrRestricted = $hiddenOrRestricted;
  216. }
  217. /**
  218. * @return array
  219. */
  220. public function getMountedForBeUsers(): array
  221. {
  222. return $this->mountedForBeUsers;
  223. }
  224. /**
  225. * @param array $mountedForBeUsers
  226. */
  227. public function setMountedForBeUsers(array $mountedForBeUsers): void
  228. {
  229. $this->mountedForBeUsers = $mountedForBeUsers;
  230. }
  231. /**
  232. * @param array $beUser ['uid' => int, 'username' => string]
  233. */
  234. public function addMountedForBeUser(array $beUser): void
  235. {
  236. $this->mountedForBeUsers[] = $beUser;
  237. }
  238. /**
  239. * @return array
  240. */
  241. public function getMountedForBeGroups(): array
  242. {
  243. return $this->mountedForBeGroups;
  244. }
  245. /**
  246. * @param array $mountedForBeGroups
  247. */
  248. public function setMountedForBeGroups(array $mountedForBeGroups): void
  249. {
  250. $this->mountedForBeGroups = $mountedForBeGroups;
  251. }
  252. /**
  253. * @param array $beGroup
  254. */
  255. public function addMountedForBeGroups(array $beGroup): void
  256. {
  257. $this->mountedForBeGroups[] = $beGroup;
  258. }
  259. /**
  260. * @return int|null
  261. */
  262. public function getOwnerUserUid(): ?int
  263. {
  264. return $this->ownerUserUid;
  265. }
  266. /**
  267. * @param int|null $ownerUserUid
  268. */
  269. public function setOwnerUserUid(?int $ownerUserUid): void
  270. {
  271. $this->ownerUserUid = $ownerUserUid;
  272. }
  273. /**
  274. * @return int|null
  275. */
  276. public function getOwnerGroupUid(): ?int
  277. {
  278. return $this->ownerGroupUid;
  279. }
  280. /**
  281. * @param int|null $ownerGroupUid
  282. */
  283. public function setOwnerGroupUid(?int $ownerGroupUid): void
  284. {
  285. $this->ownerGroupUid = $ownerGroupUid;
  286. }
  287. }