‪TYPO3CMS  ‪main
FrontendTypoScript.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 
29 {
30  private ‪RootNode|null ‪$setupTree = null;
31  private array|null ‪$setupArray = null;
32 
33  public function ‪__construct(
34  private readonly ‪RootNode $settingsTree,
35  private readonly array $flatSettings,
36  ) {}
37 
41  public function ‪getSettingsTree(): ‪RootNode
42  {
43  return $this->settingsTree;
44  }
45 
68  public function ‪getFlatSettings(): array
69  {
70  return $this->flatSettings;
71  }
72 
76  public function ‪setSetupTree(‪RootNode ‪$setupTree): void
77  {
78  $this->setupTree = ‪$setupTree;
79  }
80 
91  public function ‪hasSetup(): bool
92  {
93  return $this->setupTree !== null;
94  }
95 
99  public function ‪getSetupTree(): ‪RootNode
100  {
101  if ($this->setupTree === null) {
102  throw new \RuntimeException(
103  'Setup tree has not been initialized. This happens in cached Frontend scope where full TypoScript' .
104  ' is not needed by the system.',
105  1666513644
106  );
107  }
108  return ‪$this->setupTree;
109  }
110 
114  public function ‪setSetupArray(array ‪$setupArray): void
115  {
116  $this->setupArray = ‪$setupArray;
117  }
118 
126  public function ‪getSetupArray(): array
127  {
128  if ($this->setupArray === null) {
129  throw new \RuntimeException(
130  'Setup array has not been initialized. This happens in cached Frontend scope where full TypoScript' .
131  ' is not needed by the system.',
132  1666513645
133  );
134  }
135  return ‪$this->setupArray;
136  }
137 }
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\getSetupArray
‪getSetupArray()
Definition: FrontendTypoScript.php:126
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\getSetupTree
‪getSetupTree()
Definition: FrontendTypoScript.php:99
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\hasSetup
‪hasSetup()
Definition: FrontendTypoScript.php:91
‪TYPO3\CMS\Core\TypoScript
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\$setupTree
‪RootNode null $setupTree
Definition: FrontendTypoScript.php:30
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\getFlatSettings
‪getFlatSettings()
Definition: FrontendTypoScript.php:68
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\getSettingsTree
‪getSettingsTree()
Definition: FrontendTypoScript.php:41
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\__construct
‪__construct(private readonly RootNode $settingsTree, private readonly array $flatSettings,)
Definition: FrontendTypoScript.php:33
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\setSetupArray
‪setSetupArray(array $setupArray)
Definition: FrontendTypoScript.php:114
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\$setupArray
‪array null $setupArray
Definition: FrontendTypoScript.php:31
‪TYPO3\CMS\Core\TypoScript\AST\Node\RootNode
Definition: RootNode.php:26
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript
Definition: FrontendTypoScript.php:29
‪TYPO3\CMS\Core\TypoScript\FrontendTypoScript\setSetupTree
‪setSetupTree(RootNode $setupTree)
Definition: FrontendTypoScript.php:76