You are here

class ScheduledTransitionsNewRevisionEvent in Scheduled Transitions 8

Same name and namespace in other branches
  1. 2.x src/Event/ScheduledTransitionsNewRevisionEvent.php \Drupal\scheduled_transitions\Event\ScheduledTransitionsNewRevisionEvent

Used to determine the new revision for a transition.

Hierarchy

Expanded class hierarchy of ScheduledTransitionsNewRevisionEvent

See also

\Drupal\scheduled_transitions\Event\ScheduledTransitionsEvents

2 files declare their use of ScheduledTransitionsNewRevisionEvent
ScheduledTransitionsNewRevision.php in src/EventSubscriber/ScheduledTransitionsNewRevision.php
ScheduledTransitionsRunner.php in src/ScheduledTransitionsRunner.php

File

src/Event/ScheduledTransitionsNewRevisionEvent.php, line 14

Namespace

Drupal\scheduled_transitions\Event
View source
class ScheduledTransitionsNewRevisionEvent extends Event {

  /**
   * Scheduled transition entity.
   *
   * @var \Drupal\scheduled_transitions\Entity\ScheduledTransitionInterface
   */
  protected $scheduledTransition;

  /**
   * The new revision to transition.
   *
   * @var \Drupal\Core\Entity\RevisionableInterface|null
   */
  protected $newRevision;

  /**
   * Constructs a new ScheduledTransitionsNewRevisionEvent.
   *
   * @param \Drupal\scheduled_transitions\Entity\ScheduledTransitionInterface $scheduledTransition
   *   Scheduled transition entity.
   */
  public function __construct(ScheduledTransitionInterface $scheduledTransition) {
    $this->scheduledTransition = $scheduledTransition;
  }

  /**
   * Gets the scheduled transition entity.
   *
   * @return \Drupal\scheduled_transitions\Entity\ScheduledTransitionInterface
   *   A scheduled transition entity.
   */
  public function getScheduledTransition() : ScheduledTransitionInterface {
    return $this->scheduledTransition;
  }

  /**
   * Get the new revision.
   *
   * @return \Drupal\Core\Entity\RevisionableInterface|null
   *   The new revision.
   */
  public function getNewRevision() : ?RevisionableInterface {
    return $this->newRevision;
  }

  /**
   * Sets the new revision.
   *
   * @param \Drupal\Core\Entity\RevisionableInterface $newRevision
   *   The new revision.
   */
  public function setNewRevision(RevisionableInterface $newRevision) : void {
    $this->newRevision = $newRevision;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ScheduledTransitionsNewRevisionEvent::$newRevision protected property The new revision to transition.
ScheduledTransitionsNewRevisionEvent::$scheduledTransition protected property Scheduled transition entity.
ScheduledTransitionsNewRevisionEvent::getNewRevision public function Get the new revision.
ScheduledTransitionsNewRevisionEvent::getScheduledTransition public function Gets the scheduled transition entity.
ScheduledTransitionsNewRevisionEvent::setNewRevision public function Sets the new revision.
ScheduledTransitionsNewRevisionEvent::__construct public function Constructs a new ScheduledTransitionsNewRevisionEvent.