You are here

class NodeToUpdateEvent in GatherContent 8.4

Wraps a node to update event for event listeners.

Hierarchy

  • class \Drupal\gathercontent\Event\NodeToUpdateEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of NodeToUpdateEvent

1 file declares its use of NodeToUpdateEvent
Importer.php in src/Import/Importer.php

File

src/Event/NodeToUpdateEvent.php, line 11

Namespace

Drupal\gathercontent\Event
View source
class NodeToUpdateEvent extends Event {

  /**
   * Node object.
   *
   * @var \Drupal\node\NodeInterface|bool
   */
  protected $node = FALSE;

  /**
   * Source fields.
   *
   * @var object
   */
  protected $sourceValues;

  /**
   * Files fetched from GatherContent.
   *
   * @var array
   */
  protected $files;

  /**
   * Constructs a node to update event object.
   *
   * @param object $sourceValues
   *   Source fields representing object in GatherContent.
   * @param array $files
   *   Array of files fetched from GatherContent.
   */
  public function __construct($sourceValues, array $files) {
    $this->sourceValues = $sourceValues;
    $this->files = $files;
  }

  /**
   * Sets the node object.
   *
   * @return \Drupal\node\NodeInterface
   *   The node object.
   */
  public function setNode(NodeInterface $node) {
    $this->node = $node;
  }

  /**
   * Gets the node object if set.
   *
   * @return \Drupal\node\NodeInterface|bool
   *   The node object or false.
   */
  public function getNode() {
    return $this->node;
  }

  /**
   * Gets the array of source fields.
   *
   * @return object
   *   Source fields.
   */
  public function getSourceValues() {
    return $this->sourceValues;
  }

  /**
   * Gets the array of source files.
   *
   * @return array
   *   Source files.
   */
  public function getFiles() {
    return $this->files;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NodeToUpdateEvent::$files protected property Files fetched from GatherContent.
NodeToUpdateEvent::$node protected property Node object.
NodeToUpdateEvent::$sourceValues protected property Source fields.
NodeToUpdateEvent::getFiles public function Gets the array of source files.
NodeToUpdateEvent::getNode public function Gets the node object if set.
NodeToUpdateEvent::getSourceValues public function Gets the array of source fields.
NodeToUpdateEvent::setNode public function Sets the node object.
NodeToUpdateEvent::__construct public function Constructs a node to update event object.