summaryrefslogtreecommitdiffstatshomepage
path: root/core/lib/Drupal/Core/Plugin/PreviewAwarePluginInterface.php
blob: aaa01e5a208427db7aa27b105955ed4798f420cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

namespace Drupal\Core\Plugin;

/**
 * Provides an interface to support preview mode injection in plugins.
 *
 * Block and layout plugins can implement this interface to be informed when
 * preview mode is being used in Layout Builder.
 *
 * @see \Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent
 * @see \Drupal\layout_builder\Section::toRenderArray()
 */
interface PreviewAwarePluginInterface {

  /**
   * Set preview mode for the plugin.
   *
   * @param bool $in_preview
   *   TRUE if the plugin should be set to preview mode, FALSE otherwise.
   */
  public function setInPreview(bool $in_preview): void;

}