‪TYPO3CMS  ‪main
BeforePagePreviewUriGeneratedEvent.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\EventDispatcher\StoppableEventInterface;
21 use Psr\Http\Message\UriInterface;
23 
28 final class ‪BeforePagePreviewUriGeneratedEvent implements StoppableEventInterface
29 {
30  private ?UriInterface ‪$uri = null;
31 
32  public function ‪__construct(
33  private int $pageId,
34  private int $languageId,
35  private array $rootline,
36  private string $section,
37  private array $additionalQueryParameters,
38  private readonly ‪Context $context,
39  private readonly array $options
40  ) {}
41 
42  public function ‪setPreviewUri(UriInterface ‪$uri): void
43  {
44  $this->uri = ‪$uri;
45  }
46 
47  public function ‪getPreviewUri(): ?UriInterface
48  {
49  return ‪$this->uri;
50  }
51 
52  public function ‪isPropagationStopped(): bool
53  {
54  return $this->uri !== null;
55  }
56 
57  public function ‪getPageId(): int
58  {
59  return $this->pageId;
60  }
61 
62  public function ‪setPageId(int $pageId): void
63  {
64  $this->pageId = $pageId;
65  }
66 
67  public function ‪getLanguageId(): int
68  {
69  return $this->languageId;
70  }
71 
72  public function ‪setLanguageId(int $languageId): void
73  {
74  $this->languageId = $languageId;
75  }
76 
77  public function ‪getRootline(): array
78  {
79  return $this->rootline;
80  }
81 
82  public function ‪setRootline(array $rootline): void
83  {
84  $this->rootline = $rootline;
85  }
86 
87  public function ‪getSection(): string
88  {
89  return $this->section;
90  }
91 
92  public function ‪setSection(string $section): void
93  {
94  $this->section = $section;
95  }
96 
97  public function ‪getAdditionalQueryParameters(): array
98  {
99  return $this->additionalQueryParameters;
100  }
101 
102  public function ‪setAdditionalQueryParameters(array $additionalQueryParameters): void
103  {
104  $this->additionalQueryParameters = $additionalQueryParameters;
105  }
106 
107  public function ‪getContext(): ‪Context
108  {
109  return $this->context;
110  }
111 
112  public function ‪getOptions(): array
113  {
114  return $this->options;
115  }
116 }
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\setAdditionalQueryParameters
‪setAdditionalQueryParameters(array $additionalQueryParameters)
Definition: BeforePagePreviewUriGeneratedEvent.php:102
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\setRootline
‪setRootline(array $rootline)
Definition: BeforePagePreviewUriGeneratedEvent.php:82
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\getPreviewUri
‪getPreviewUri()
Definition: BeforePagePreviewUriGeneratedEvent.php:47
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\getAdditionalQueryParameters
‪getAdditionalQueryParameters()
Definition: BeforePagePreviewUriGeneratedEvent.php:97
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\setSection
‪setSection(string $section)
Definition: BeforePagePreviewUriGeneratedEvent.php:92
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\getContext
‪getContext()
Definition: BeforePagePreviewUriGeneratedEvent.php:107
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\__construct
‪__construct(private int $pageId, private int $languageId, private array $rootline, private string $section, private array $additionalQueryParameters, private readonly Context $context, private readonly array $options)
Definition: BeforePagePreviewUriGeneratedEvent.php:32
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\$uri
‪UriInterface $uri
Definition: BeforePagePreviewUriGeneratedEvent.php:30
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:54
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\setLanguageId
‪setLanguageId(int $languageId)
Definition: BeforePagePreviewUriGeneratedEvent.php:72
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\getPageId
‪getPageId()
Definition: BeforePagePreviewUriGeneratedEvent.php:57
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\setPageId
‪setPageId(int $pageId)
Definition: BeforePagePreviewUriGeneratedEvent.php:62
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\getSection
‪getSection()
Definition: BeforePagePreviewUriGeneratedEvent.php:87
‪TYPO3\CMS\Backend\Routing\Event
Definition: AfterPagePreviewUriGeneratedEvent.php:18
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\setPreviewUri
‪setPreviewUri(UriInterface $uri)
Definition: BeforePagePreviewUriGeneratedEvent.php:42
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\getRootline
‪getRootline()
Definition: BeforePagePreviewUriGeneratedEvent.php:77
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\getOptions
‪getOptions()
Definition: BeforePagePreviewUriGeneratedEvent.php:112
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent
Definition: BeforePagePreviewUriGeneratedEvent.php:29
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\isPropagationStopped
‪isPropagationStopped()
Definition: BeforePagePreviewUriGeneratedEvent.php:52
‪TYPO3\CMS\Backend\Routing\Event\BeforePagePreviewUriGeneratedEvent\getLanguageId
‪getLanguageId()
Definition: BeforePagePreviewUriGeneratedEvent.php:67