You are here

class LayoutParagraphsUpdateLayoutEvent in Layout Paragraphs 2.0.x

Class definition for Layout Paragraphs Allowed Types event.

Hierarchy

Expanded class hierarchy of LayoutParagraphsUpdateLayoutEvent

2 files declare their use of LayoutParagraphsUpdateLayoutEvent
LayoutParagraphsLayoutRefreshTrait.php in src/LayoutParagraphsLayoutRefreshTrait.php
LayoutParagraphsUpdateLayoutSubscriber.php in src/EventSubscriber/LayoutParagraphsUpdateLayoutSubscriber.php

File

src/Event/LayoutParagraphsUpdateLayoutEvent.php, line 11

Namespace

Drupal\layout_paragraphs\Event
View source
class LayoutParagraphsUpdateLayoutEvent extends Event {
  const EVENT_NAME = 'layout_paragraphs_update_layout';

  /**
   * The origin layout object.
   *
   * @var \Drupal\layout_paragraphs\LayoutParagraphsLayout
   */
  protected $originalLayout;

  /**
   * The updated layout object.
   *
   * @var \Drupal\layout_paragraphs\LayoutParagraphsLayout
   */
  protected $layout;

  /**
   * TRUE if the entire layout needs to be refreshed.
   *
   * @var bool
   */
  public $needsRefresh = FALSE;

  /**
   * Class cosntructor.
   *
   * @param \Drupal\layout_paragraphs\LayoutParagraphsLayout $original_layout
   *   The layout object.
   * @param \Drupal\layout_paragraphs\LayoutParagraphsLayout $layout
   *   The layout object.
   */
  public function __construct(LayoutParagraphsLayout $original_layout, LayoutParagraphsLayout $layout) {
    $this->originalLayout = $original_layout;
    $this->layout = $layout;
  }

  /**
   * Get the original layout.
   *
   * @return \Drupal\layout_paragraphs\LayoutParagraphsLayout
   *   The original layout.
   */
  public function getOriginalLayout() {
    return $this->originalLayout;
  }

  /**
   * Get the updated layout.
   *
   * @return \Drupal\layout_paragraphs\LayoutParagraphsLayout
   *   The updated layout.
   */
  public function getUpdatedLayout() {
    return $this->layout;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LayoutParagraphsUpdateLayoutEvent::$layout protected property The updated layout object.
LayoutParagraphsUpdateLayoutEvent::$needsRefresh public property TRUE if the entire layout needs to be refreshed.
LayoutParagraphsUpdateLayoutEvent::$originalLayout protected property The origin layout object.
LayoutParagraphsUpdateLayoutEvent::EVENT_NAME constant
LayoutParagraphsUpdateLayoutEvent::getOriginalLayout public function Get the original layout.
LayoutParagraphsUpdateLayoutEvent::getUpdatedLayout public function Get the updated layout.
LayoutParagraphsUpdateLayoutEvent::__construct public function Class cosntructor.