You are here

class StepChangeEvent in Forms Steps 8

Event that is fired when before we switch from one step to another.

Hierarchy

  • class \Drupal\forms_steps\Event\StepChangeEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of StepChangeEvent

1 file declares its use of StepChangeEvent
FormsStepsAlter.php in src/Form/FormsStepsAlter.php

File

src/Event/StepChangeEvent.php, line 13

Namespace

Drupal\forms_steps\Event
View source
class StepChangeEvent extends Event {
  const STEP_CHANGE_EVENT = 'forms_steps.step_change_event';

  /**
   * The FormsSteps object.
   *
   * @var \Drupal\forms_steps\Entity\FormsSteps
   */
  public $formsSteps;

  /**
   * The current step.
   *
   * @var \Drupal\forms_steps\StepInterface
   */
  public $fromStep;

  /**
   * The step we are jumping to (can be previous one or next one).
   *
   * @var \Drupal\forms_steps\StepInterface
   */
  public $toStep;

  /**
   * The formState object.
   *
   * @var \Drupal\Core\Form\FormState
   */
  public $formState;

  /**
   * Constructs the object.
   *
   * @param \Drupal\forms_steps\Entity\FormsSteps $forms_steps
   *  The FormsSteps object.
   * @param \Drupal\forms_steps\Step $from_step
   *  The step the user is currently on.
   * @param \Drupal\forms_steps\Step $to_step
   *  The next/previous step the user is going to be redirected.
   * @param FormState $form_state
   *  The formState.
   */
  public function __construct(FormsSteps $forms_steps, Step $from_step, Step $to_step, FormState $form_state) {
    $this->formsSteps = $forms_steps;
    $this->fromStep = $from_step;
    $this->toStep = $to_step;
    $this->formState = $form_state;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
StepChangeEvent::$formsSteps public property The FormsSteps object.
StepChangeEvent::$formState public property The formState object.
StepChangeEvent::$fromStep public property The current step.
StepChangeEvent::$toStep public property The step we are jumping to (can be previous one or next one).
StepChangeEvent::STEP_CHANGE_EVENT constant
StepChangeEvent::__construct public function Constructs the object.