You are here

class LayoutParagraphsAllowedTypesEvent in Layout Paragraphs 2.0.x

Class definition for Layout Paragraphs Allowed Types event.

Hierarchy

Expanded class hierarchy of LayoutParagraphsAllowedTypesEvent

2 files declare their use of LayoutParagraphsAllowedTypesEvent
ChooseComponentController.php in src/Controller/ChooseComponentController.php
LayoutParagraphsAllowedTypesSubscriber.php in src/EventSubscriber/LayoutParagraphsAllowedTypesSubscriber.php

File

src/Event/LayoutParagraphsAllowedTypesEvent.php, line 11

Namespace

Drupal\layout_paragraphs\Event
View source
class LayoutParagraphsAllowedTypesEvent extends Event {
  const EVENT_NAME = 'layout_paragraphs_allowed_types';

  /**
   * An array of component (paragraph) types.
   *
   * @var array
   */
  protected $types = [];

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

  /**
   * The parent uuid.
   *
   * @var string
   */
  protected $parentUuid;

  /**
   * The region name.
   *
   * @var string
   */
  protected $region;

  /**
   * Class cosntructor.
   *
   * @param array $types
   *   An array of paragraph types.
   * @param \Drupal\layout_paragraphs\LayoutParagraphsLayout $layout
   *   The layout object.
   * @param string $parent_uuid
   *   The parent uuid.
   * @param string $region
   *   The region.
   */
  public function __construct(array $types, LayoutParagraphsLayout $layout, $parent_uuid = '', $region = '') {
    $this->types = $types;
    $this->layout = $layout;
    $this->parentUuid = $parent_uuid;
    $this->region = $region;
  }

  /**
   * Returns the array of types.
   *
   * @return array[]
   *   The types array.
   */
  public function getTypes() {
    return $this->types;
  }

  /**
   * Sets the types array.
   *
   * @param array $types
   *   The types array.
   *
   * @return $this
   */
  public function setTypes(array $types) {
    $this->types = $types;
    return $this;
  }

  /**
   * Get the parent uuid.
   *
   * @return string
   *   The parent uuid.
   */
  public function getParentUuid() {
    return $this->parentUuid;
  }

  /**
   * Get the region.
   *
   * @return string
   *   The region.
   */
  public function getRegion() {
    return $this->region;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
LayoutParagraphsAllowedTypesEvent::$layout protected property The layout object.
LayoutParagraphsAllowedTypesEvent::$parentUuid protected property The parent uuid.
LayoutParagraphsAllowedTypesEvent::$region protected property The region name.
LayoutParagraphsAllowedTypesEvent::$types protected property An array of component (paragraph) types.
LayoutParagraphsAllowedTypesEvent::EVENT_NAME constant
LayoutParagraphsAllowedTypesEvent::getLayout public function Get the layout.
LayoutParagraphsAllowedTypesEvent::getParentUuid public function Get the parent uuid.
LayoutParagraphsAllowedTypesEvent::getRegion public function Get the region.
LayoutParagraphsAllowedTypesEvent::getTypes public function Returns the array of types.
LayoutParagraphsAllowedTypesEvent::setTypes public function Sets the types array.
LayoutParagraphsAllowedTypesEvent::__construct public function Class cosntructor.