You are here

class ViewsBulkOperationsEvent in Views Bulk Operations (VBO) 8.2

Same name and namespace in other branches
  1. 8.3 src/ViewsBulkOperationsEvent.php \Drupal\views_bulk_operations\ViewsBulkOperationsEvent
  2. 8 src/ViewsBulkOperationsEvent.php \Drupal\views_bulk_operations\ViewsBulkOperationsEvent
  3. 4.0.x src/ViewsBulkOperationsEvent.php \Drupal\views_bulk_operations\ViewsBulkOperationsEvent

Defines Views Bulk Operations event type.

Hierarchy

Expanded class hierarchy of ViewsBulkOperationsEvent

2 files declare their use of ViewsBulkOperationsEvent
ViewsBulkOperationsEventSubscriber.php in src/EventSubscriber/ViewsBulkOperationsEventSubscriber.php
ViewsBulkOperationsViewData.php in src/Service/ViewsBulkOperationsViewData.php

File

src/ViewsBulkOperationsEvent.php, line 11

Namespace

Drupal\views_bulk_operations
View source
class ViewsBulkOperationsEvent extends Event {
  const NAME = 'views_bulk_operations.view_data';

  /**
   * The provider of the current view.
   *
   * @var string
   */
  protected $provider;

  /**
   * The views data of the current view.
   *
   * @var array
   */
  protected $viewData;

  /**
   * The current view object.
   *
   * @var \Drupal\views\ViewExecutable
   */
  protected $view;

  /**
   * IDs of entity types returned by the view.
   *
   * @var array
   */
  protected $entityTypeIds;

  /**
   * Row entity getter information.
   *
   * @var array
   */
  protected $entityGetter;

  /**
   * Object constructor.
   *
   * @param string $provider
   *   The provider of the current view.
   * @param array $viewData
   *   The views data of the current view.
   * @param \Drupal\views\ViewExecutable $view
   *   The current view.
   */
  public function __construct($provider, array $viewData, ViewExecutable $view) {
    $this->provider = $provider;
    $this->viewData = $viewData;
    $this->view = $view;
  }

  /**
   * Get view provider.
   *
   * @return string
   *   The view provider
   */
  public function getProvider() {
    return $this->provider;
  }

  /**
   * Get view data.
   *
   * @return string
   *   The current view data
   */
  public function getViewData() {
    return $this->viewData;
  }

  /**
   * Get current view.
   *
   * @return \Drupal\views\ViewExecutable
   *   The current view object
   */
  public function getView() {
    return $this->view;
  }

  /**
   * Get entity type IDs displayed by the current view.
   *
   * @return array
   *   Entity type IDs.
   */
  public function getEntityTypeIds() {
    return $this->entityTypeIds;
  }

  /**
   * Get entity getter callable.
   *
   * @return array
   *   Entity getter information.
   */
  public function getEntityGetter() {
    return $this->entityGetter;
  }

  /**
   * Set entity type IDs.
   *
   * @param array $entityTypeIds
   *   Entity type IDs.
   */
  public function setEntityTypeIds(array $entityTypeIds) {
    $this->entityTypeIds = $entityTypeIds;
  }

  /**
   * Set entity getter callable.
   *
   * @param array $entityGetter
   *   Entity getter information.
   */
  public function setEntityGetter(array $entityGetter) {
    if (!isset($entityGetter['callable'])) {
      throw new \Exception('Views Bulk Operations entity getter callable is not defined.');
    }
    $this->entityGetter = $entityGetter;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ViewsBulkOperationsEvent::$entityGetter protected property Row entity getter information.
ViewsBulkOperationsEvent::$entityTypeIds protected property IDs of entity types returned by the view.
ViewsBulkOperationsEvent::$provider protected property The provider of the current view.
ViewsBulkOperationsEvent::$view protected property The current view object.
ViewsBulkOperationsEvent::$viewData protected property The views data of the current view.
ViewsBulkOperationsEvent::getEntityGetter public function Get entity getter callable.
ViewsBulkOperationsEvent::getEntityTypeIds public function Get entity type IDs displayed by the current view.
ViewsBulkOperationsEvent::getProvider public function Get view provider.
ViewsBulkOperationsEvent::getView public function Get current view.
ViewsBulkOperationsEvent::getViewData public function Get view data.
ViewsBulkOperationsEvent::NAME constant
ViewsBulkOperationsEvent::setEntityGetter public function Set entity getter callable.
ViewsBulkOperationsEvent::setEntityTypeIds public function Set entity type IDs.
ViewsBulkOperationsEvent::__construct public function Object constructor.