You are here

class RelationshipFieldValueEvent in Entity Share 8.3

Same name and namespace in other branches
  1. 8 modules/entity_share_client/src/Event/RelationshipFieldValueEvent.php \Drupal\entity_share_client\Event\RelationshipFieldValueEvent
  2. 8.2 modules/entity_share_client/src/Event/RelationshipFieldValueEvent.php \Drupal\entity_share_client\Event\RelationshipFieldValueEvent

Defines a RelationshipFieldValueEvent event.

Hierarchy

Expanded class hierarchy of RelationshipFieldValueEvent

2 files declare their use of RelationshipFieldValueEvent
EntityReference.php in modules/entity_share_client/src/Plugin/EntityShareClient/Processor/EntityReference.php
EntityReferenceRevisionsRelationshipSubscriber.php in modules/entity_share_client/src/EventSubscriber/EntityReferenceRevisionsRelationshipSubscriber.php

File

modules/entity_share_client/src/Event/RelationshipFieldValueEvent.php, line 13

Namespace

Drupal\entity_share_client\Event
View source
class RelationshipFieldValueEvent extends Event {
  const EVENT_NAME = 'entity_share_client.relationship_field_value';

  /**
   * A FieldItemList object.
   *
   * @var \Drupal\Core\Field\FieldItemListInterface
   */
  protected $field;

  /**
   * An array of the field value to alter.
   *
   * @var array
   */
  protected $fieldValue;

  /**
   * Constructs a new RelationshipFieldValueEvent.
   *
   * @param \Drupal\Core\Field\FieldItemListInterface $field
   *   A FieldItemList object.
   * @param array $field_value
   *   An array of the field value to alter.
   */
  public function __construct(FieldItemListInterface $field, array $field_value) {
    $this->field = $field;
    $this->fieldValue = $field_value;
  }

  /**
   * Returns the FieldItemList object.
   *
   * @return \Drupal\Core\Field\FieldItemListInterface
   *   Returns the FieldItemList object.
   */
  public function getField() {
    return $this->field;
  }

  /**
   * Returns the field value.
   *
   * @return array
   *   Returns the field value.
   */
  public function getFieldValue() {
    return $this->fieldValue;
  }

  /**
   * Set the field value.
   *
   * @param array $field_value
   *   The field value.
   */
  public function setFieldValue(array $field_value) {
    $this->fieldValue = $field_value;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RelationshipFieldValueEvent::$field protected property A FieldItemList object.
RelationshipFieldValueEvent::$fieldValue protected property An array of the field value to alter.
RelationshipFieldValueEvent::EVENT_NAME constant
RelationshipFieldValueEvent::getField public function Returns the FieldItemList object.
RelationshipFieldValueEvent::getFieldValue public function Returns the field value.
RelationshipFieldValueEvent::setFieldValue public function Set the field value.
RelationshipFieldValueEvent::__construct public function Constructs a new RelationshipFieldValueEvent.