You are here

EntityBaseFieldInfoAlterEvent.php in Hook Event Dispatcher 8

File

src/Event/EntityType/EntityBaseFieldInfoAlterEvent.php
View source
<?php

namespace Drupal\hook_event_dispatcher\Event\EntityType;

use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\hook_event_dispatcher\Event\EventInterface;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Symfony\Component\EventDispatcher\Event;

/**
 * Class EntityBaseFieldInfoAlterEvent.
 */
class EntityBaseFieldInfoAlterEvent extends Event implements EventInterface {

  /**
   * Field info.
   *
   * @var array
   */
  private $fields;

  /**
   * The entity type.
   *
   * @var \Drupal\Core\Entity\EntityTypeInterface
   */
  private $entityType;

  /**
   * EntityExtraFieldInfoAlterEvent constructor.
   *
   * @param array $fields
   *   Extra field info.
   * @param \Drupal\Core\Entity\EntityTypeInterface $entityType
   *   The entity type.
   */
  public function __construct(array &$fields, EntityTypeInterface $entityType) {
    $this->entityType = $entityType;
    $this->fields =& $fields;
  }

  /**
   * {@inheritdoc}
   */
  public function getDispatcherType() {
    return HookEventDispatcherInterface::ENTITY_BASE_FIELD_INFO_ALTER;
  }

  /**
   * Get the field info.
   *
   * @return array
   *   Extra field info.
   */
  public function &getFields() {
    return $this->fields;
  }

  /**
   * Get the entity type.
   *
   * @return \Drupal\Core\Entity\EntityTypeInterface
   *   The entity type.
   */
  public function getEntityType() {
    return $this->entityType;
  }

}

Classes

Namesort descending Description
EntityBaseFieldInfoAlterEvent Class EntityBaseFieldInfoAlterEvent.