You are here

class FilterDependencyCalculationFieldsEvent in Dependency Calculation 8

The FilterDependencyCalculationFieldsEvent event.

Hierarchy

Expanded class hierarchy of FilterDependencyCalculationFieldsEvent

1 file declares its use of FilterDependencyCalculationFieldsEvent
FieldExtractor.php in src/FieldExtractor.php

File

src/Event/FilterDependencyCalculationFieldsEvent.php, line 12

Namespace

Drupal\depcalc\Event
View source
class FilterDependencyCalculationFieldsEvent extends Event {

  /**
   * The entity to calculate dependencies.
   *
   * @var \Drupal\Core\Entity\ContentEntityInterface
   */
  protected $entity;

  /**
   * The entity fields.
   *
   * @var \Drupal\Core\Field\FieldItemListInterface[]
   */
  protected $fields;

  /**
   * FilterDependencyCalculationFieldsEvent constructor.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The entity.
   * @param \Drupal\Core\Field\FieldItemListInterface ...$fields
   *   The fields.
   */
  public function __construct(ContentEntityInterface $entity, FieldItemListInterface ...$fields) {
    $this->entity = $entity;
    $this->fields = $fields;
  }

  /**
   * Retrieve the entity object
   *
   * @return \Drupal\Core\Entity\ContentEntityInterface
   *   The entity.
   */
  public function getEntity() {
    return $this->entity;
  }

  /**
   * Get the fields to be filtered.
   *
   * @return \Drupal\Core\Field\FieldItemListInterface[]
   *   The fields.
   */
  public function getFields() {
    return $this->fields;
  }

  /**
   * Set a filtered list of fields.
   *
   * @param \Drupal\Core\Field\FieldItemListInterface ...$fields
   *   The fields.
   */
  public function setFields(FieldItemListInterface ...$fields) {
    $this->fields = $fields;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FilterDependencyCalculationFieldsEvent::$entity protected property The entity to calculate dependencies.
FilterDependencyCalculationFieldsEvent::$fields protected property The entity fields.
FilterDependencyCalculationFieldsEvent::getEntity public function Retrieve the entity object
FilterDependencyCalculationFieldsEvent::getFields public function Get the fields to be filtered.
FilterDependencyCalculationFieldsEvent::setFields public function Set a filtered list of fields.
FilterDependencyCalculationFieldsEvent::__construct public function FilterDependencyCalculationFieldsEvent constructor.