d86cddff6f4fed17bfdf614401e72fe9ce0731f2
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Site / Entity / SiteInterface.php
1 <?php
2 declare(strict_types = 1);
3
4 namespace TYPO3\CMS\Core\Site\Entity;
5
6 /*
7 * This file is part of the TYPO3 CMS project.
8 *
9 * It is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, either version 2
11 * of the License, or any later version.
12 *
13 * For the full copyright and license information, please read the
14 * LICENSE.txt file that was distributed with this source code.
15 *
16 * The TYPO3 project - inspiring people to share!
17 */
18
19 use TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface;
20 use TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerNotConfiguredException;
21
22 interface SiteInterface
23 {
24 /**
25 * Returns the root page ID of this site
26 *
27 * @return int
28 */
29 public function getRootPageId(): int;
30
31 /**
32 * Returns all available languages of this site visible in the frontend
33 *
34 * @return SiteLanguage[]
35 */
36 public function getLanguages(): array;
37
38 /**
39 * Returns a language of this site, given by the sys_language_uid
40 *
41 * @param int $languageId
42 * @return SiteLanguage
43 * @throws \InvalidArgumentException
44 */
45 public function getLanguageById(int $languageId): SiteLanguage;
46
47 /**
48 * Returns a ready-to-use error handler, to be used within the ErrorController
49 *
50 * @param int $statusCode
51 * @return PageErrorHandlerInterface
52 * @throws PageErrorHandlerNotConfiguredException
53 */
54 public function getErrorHandler(int $statusCode): PageErrorHandlerInterface;
55 }