‪TYPO3CMS  ‪main
AfterCacheableContentIsGeneratedEvent.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 
20 use Psr\Http\Message\ServerRequestInterface;
22 
29 {
30  public function ‪__construct(
31  private readonly ServerRequestInterface $request,
32  private readonly ‪TypoScriptFrontendController $controller,
33  private readonly string $cacheIdentifier,
34  private bool $usePageCache
35  ) {}
36 
37  public function ‪getRequest(): ServerRequestInterface
38  {
39  return $this->request;
40  }
41 
43  {
44  return $this->controller;
45  }
46 
47  public function ‪isCachingEnabled(): bool
48  {
49  return $this->usePageCache;
50  }
51 
52  public function ‪disableCaching(): void
53  {
54  $this->usePageCache = false;
55  }
56 
57  public function ‪enableCaching(): void
58  {
59  $this->usePageCache = true;
60  }
61 
62  public function ‪getCacheIdentifier(): string
63  {
64  return $this->cacheIdentifier;
65  }
66 }
‪TYPO3\CMS\Frontend\Event
Definition: AfterCacheableContentIsGeneratedEvent.php:18
‪TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent\__construct
‪__construct(private readonly ServerRequestInterface $request, private readonly TypoScriptFrontendController $controller, private readonly string $cacheIdentifier, private bool $usePageCache)
Definition: AfterCacheableContentIsGeneratedEvent.php:30
‪TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent\getRequest
‪getRequest()
Definition: AfterCacheableContentIsGeneratedEvent.php:37
‪TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent\isCachingEnabled
‪isCachingEnabled()
Definition: AfterCacheableContentIsGeneratedEvent.php:47
‪TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent\getController
‪getController()
Definition: AfterCacheableContentIsGeneratedEvent.php:42
‪TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent\disableCaching
‪disableCaching()
Definition: AfterCacheableContentIsGeneratedEvent.php:52
‪TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent
Definition: AfterCacheableContentIsGeneratedEvent.php:29
‪TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent\getCacheIdentifier
‪getCacheIdentifier()
Definition: AfterCacheableContentIsGeneratedEvent.php:62
‪TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent\enableCaching
‪enableCaching()
Definition: AfterCacheableContentIsGeneratedEvent.php:57
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:58