You are here

class PreNodeSaveEvent in GatherContent 8.3

Same name and namespace in other branches
  1. 8.4 src/Event/PreNodeSaveEvent.php \Drupal\gathercontent\Event\PreNodeSaveEvent

Wraps a pre node save event for event listeners.

Hierarchy

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

Expanded class hierarchy of PreNodeSaveEvent

1 file declares its use of PreNodeSaveEvent
gathercontent.module in ./gathercontent.module
Main module file for GatherContent module.

File

src/Event/PreNodeSaveEvent.php, line 11

Namespace

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

  /**
   * Node object.
   *
   * @var \Drupal\node\NodeInterface
   */
  protected $node;

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

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

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

  /**
   * Gets the node object.
   *
   * @return \Drupal\node\NodeInterface
   *   The node object.
   */
  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
PreNodeSaveEvent::$files protected property Files fetched from GatherContent.
PreNodeSaveEvent::$node protected property Node object.
PreNodeSaveEvent::$sourceValues protected property Source fields.
PreNodeSaveEvent::getFiles public function Gets the array of source files.
PreNodeSaveEvent::getNode public function Gets the node object.
PreNodeSaveEvent::getSourceValues public function Gets the array of source fields.
PreNodeSaveEvent::__construct public function Constructs a pre node save event object.