SiteInfos.php 6.8 KB

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