You are here

class ReplicationContentDataAlterEvent in Replication 8.2

Same name and namespace in other branches
  1. 8 src/Event/ReplicationContentDataAlterEvent.php \Drupal\replication\Event\ReplicationContentDataAlterEvent

Event instance for altering normalized content entity data.

Hierarchy

Expanded class hierarchy of ReplicationContentDataAlterEvent

2 files declare their use of ReplicationContentDataAlterEvent
ContentEntityNormalizer.php in src/Normalizer/ContentEntityNormalizer.php
ContentEntityTestAlterSubscriber.php in tests/modules/replication_alter_test/src/Event/ContentEntityTestAlterSubscriber.php

File

src/Event/ReplicationContentDataAlterEvent.php, line 12

Namespace

Drupal\replication\Event
View source
class ReplicationContentDataAlterEvent extends Event {

  /**
   * The entity being normalized.
   *
   * @var \Drupal\Core\Entity\ContentEntityInterface
   */
  protected $entity;

  /**
   * The data being normalized.
   *
   * @var array
   */
  protected $data;

  /**
   * @var string
   */
  protected $format;

  /**
   * @var array
   */
  protected $context;

  /**
   * ReplicationContentDataAlterEvent constructor.
   *
   * @param ContentEntityInterface $entity
   * @param array $data
   * @param $format
   * @param array $context
   */
  public function __construct(ContentEntityInterface $entity, array $data, $format, array $context) {
    $this->entity = $entity;
    $this->data = $data;
    $this->format = $format;
    $this->context = $context;
  }

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

  /**
   * @return string
   */
  public function getFormat() {
    return $this->format;
  }

  /**
   * @return array
   */
  public function getContext() {
    return $this->context;
  }

  /**
   * @return array
   */
  public function getData() {
    return $this->data;
  }

  /**
   * @param array $data
   */
  public function setData(array $data) {
    $this->data = $data;
  }

}

Members