‪TYPO3CMS  ‪main
PageContentPreviewRenderingEvent.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;
22 
26 final class ‪PageContentPreviewRenderingEvent implements StoppableEventInterface
27 {
28  private ?string ‪$content = null;
29 
30  public function ‪__construct(
31  private readonly string $table,
32  private array ‪$record,
33  private readonly ‪PageLayoutContext $context
34  ) {}
35 
36  public function ‪getTable(): string
37  {
38  return $this->table;
39  }
40 
41  public function ‪getRecord(): array
42  {
43  return ‪$this->record;
44  }
45 
46  public function ‪setRecord(array ‪$record): void
47  {
48  $this->record = ‪$record;
49  }
50 
52  {
53  return $this->context;
54  }
55 
56  public function ‪getPreviewContent(): ?string
57  {
58  return ‪$this->content;
59  }
60 
61  public function ‪setPreviewContent(string ‪$content): void
62  {
63  $this->content = ‪$content;
64  }
65 
66  public function ‪isPropagationStopped(): bool
67  {
68  return $this->content !== null;
69  }
70 }
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent\__construct
‪__construct(private readonly string $table, private array $record, private readonly PageLayoutContext $context)
Definition: PageContentPreviewRenderingEvent.php:30
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent\isPropagationStopped
‪isPropagationStopped()
Definition: PageContentPreviewRenderingEvent.php:66
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent\setPreviewContent
‪setPreviewContent(string $content)
Definition: PageContentPreviewRenderingEvent.php:61
‪TYPO3\CMS\Backend\View\Event
Definition: AbstractSectionMarkupGeneratedEvent.php:18
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent\getTable
‪getTable()
Definition: PageContentPreviewRenderingEvent.php:36
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent\setRecord
‪setRecord(array $record)
Definition: PageContentPreviewRenderingEvent.php:46
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent\getPreviewContent
‪getPreviewContent()
Definition: PageContentPreviewRenderingEvent.php:56
‪TYPO3\CMS\Webhooks\Message\$record
‪identifier readonly int readonly array $record
Definition: PageModificationMessage.php:36
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent\getPageLayoutContext
‪getPageLayoutContext()
Definition: PageContentPreviewRenderingEvent.php:51
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent\getRecord
‪getRecord()
Definition: PageContentPreviewRenderingEvent.php:41
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent\$content
‪string $content
Definition: PageContentPreviewRenderingEvent.php:28
‪TYPO3\CMS\Backend\View\PageLayoutContext
Definition: PageLayoutContext.php:42
‪TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent
Definition: PageContentPreviewRenderingEvent.php:27