You are here

class PageManagerContextEvent in Page Manager 8

Same name and namespace in other branches
  1. 8.4 src/Event/PageManagerContextEvent.php \Drupal\page_manager\Event\PageManagerContextEvent

Wraps a page entity for event subscribers.

Hierarchy

Expanded class hierarchy of PageManagerContextEvent

See also

\Drupal\page_manager\Event\PageManagerEvents::PAGE_CONTEXT

5 files declare their use of PageManagerContextEvent
CurrentUserContext.php in src/EventSubscriber/CurrentUserContext.php
Contains \Drupal\page_manager\EventSubscriber\CurrentUserContext.
Page.php in src/Entity/Page.php
Contains \Drupal\page_manager\Entity\Page.
PageContextTestBase.php in tests/src/Unit/PageContextTestBase.php
Contains \Drupal\Tests\page_manager\Unit\PageContextTestBase.
PageTest.php in tests/src/Unit/PageTest.php
Contains \Drupal\Tests\page_manager\Unit\PageTest.
RouteParamContext.php in src/EventSubscriber/RouteParamContext.php
Contains \Drupal\page_manager\EventSubscriber\RouteParamContext.

File

src/Event/PageManagerContextEvent.php, line 18
Contains \Drupal\page_manager\Event\PageManagerContextEvent.

Namespace

Drupal\page_manager\Event
View source
class PageManagerContextEvent extends Event {

  /**
   * The page entity the context is gathered for.
   *
   * @var \Drupal\page_manager\PageInterface
   */
  protected $page;

  /**
   * Creates a new PageManagerContextEvent.
   *
   * @param \Drupal\page_manager\PageInterface $page
   *   The page entity.
   */
  public function __construct(PageInterface $page) {
    $this->page = $page;
  }

  /**
   * Returns the page entity for this event.
   *
   * @return \Drupal\page_manager\PageInterface
   *   The page entity.
   */
  public function getPage() {
    return $this->page;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PageManagerContextEvent::$page protected property The page entity the context is gathered for.
PageManagerContextEvent::getPage public function Returns the page entity for this event.
PageManagerContextEvent::__construct public function Creates a new PageManagerContextEvent.