You are here

class EntityEvent in Feeds 8.3

Fired at various phases during the process stage.

Hierarchy

  • class \Drupal\feeds\Event\EventBase extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of EntityEvent

2 files declare their use of EntityEvent
Feed.php in src/Entity/Feed.php
FeedsSubscriber.php in tests/modules/feeds_test_events/src/EventSubscriber/FeedsSubscriber.php

File

src/Event/EntityEvent.php, line 12

Namespace

Drupal\feeds\Event
View source
class EntityEvent extends EventBase {

  /**
   * The entity being inserted or updated.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $entity;

  /**
   * The item that is being processed.
   *
   * @var \Drupal\feeds\Feeds\Item\ItemInterface
   */
  protected $item;

  /**
   * Constructs an EntityEvent object.
   *
   * @param \Drupal\feeds\FeedInterface $feed
   *   The feed.
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity being inserted or updated.
   * @param \Drupal\feeds\Feeds\Item\ItemInterface $item
   *   The item that is being processed.
   */
  public function __construct(FeedInterface $feed, EntityInterface $entity, ItemInterface $item) {
    parent::__construct($feed);
    $this->entity = $entity;
    $this->item = $item;
  }

  /**
   * Returns the entity.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The entity being inserted or updated.
   */
  public function getEntity() {
    return $this->entity;
  }

  /**
   * Returns the item.
   *
   * @return \Drupal\feeds\Feeds\Item\ItemInterface
   *   The item that is being processed.
   */
  public function getItem() {
    return $this->item;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityEvent::$entity protected property The entity being inserted or updated.
EntityEvent::$item protected property The item that is being processed.
EntityEvent::getEntity public function Returns the entity.
EntityEvent::getItem public function Returns the item.
EntityEvent::__construct public function Constructs an EntityEvent object. Overrides EventBase::__construct
EventBase::$feed protected property The feed being imported.
EventBase::getFeed public function Returns the feed.