You are here

class PaymentStatusSet in Payment 8.2

Provides an event that is dispatched after a new status is set on a payment.

Hierarchy

  • class \Drupal\payment\Event\PaymentStatusSet extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of PaymentStatusSet

See also

\Drupal\payment\Event\PaymentEvents::PAYMENT_STATUS_SET

4 files declare their use of PaymentStatusSet
EventDispatcherCollectionTest.php in tests/src/Unit/EventDispatcherCollectionTest.php
PaymentStatusSetTest.php in tests/src/Unit/Event/PaymentStatusSetTest.php
SymfonyEventDispatcher.php in src/SymfonyEventDispatcher.php
SymfonyEventDispatcherTest.php in tests/src/Unit/SymfonyEventDispatcherTest.php

File

src/Event/PaymentStatusSet.php, line 14

Namespace

Drupal\payment\Event
View source
class PaymentStatusSet extends Event {

  /**
   * The payment.
   *
   * @var \Drupal\payment\Entity\PaymentInterface
   */
  protected $payment;

  /**
   * The previous payment status.
   *
   * @var \Drupal\payment\Plugin\Payment\Status\PaymentStatusInterface|null
   */
  protected $previousPaymentStatus;

  /**-
   * Constructs a new instance.
   *
   * @param \Drupal\payment\Entity\PaymentInterface $payment
   *   The payment the status was set on.
   * @param \Drupal\payment\Plugin\Payment\Status\PaymentStatusInterface|null $previous_payment_status
   *   The payment's previous status or NULL if there is none.
   */
  public function __construct(PaymentInterface $payment, PaymentStatusInterface $previous_payment_status = NULL) {
    $this->payment = $payment;
    $this->previousPaymentStatus = $previous_payment_status;
  }

  /**
   * Gets the payment the status was set on.
   *
   * @return \Drupal\payment\Entity\PaymentInterface
   */
  public function getPayment() {
    return $this->payment;
  }

  /**
   * Gets the payment's previous status.
   *
   * @return \Drupal\payment\Plugin\Payment\Status\PaymentStatusInterface|null
   *   The previous status, or NULL of there is none.
   */
  public function getPreviousPaymentStatus() {
    return $this->previousPaymentStatus;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PaymentStatusSet::$payment protected property The payment.
PaymentStatusSet::$previousPaymentStatus protected property The previous payment status.
PaymentStatusSet::getPayment public function Gets the payment the status was set on.
PaymentStatusSet::getPreviousPaymentStatus public function Gets the payment's previous status.
PaymentStatusSet::__construct public function