You are here

public function EventDispatcherCollection::setPaymentStatus in Payment 8.2

Responds to a new payment status being set.

Parameters

\Drupal\payment\Entity\PaymentInterface $payment: The payment on which the new status has been set.

\Drupal\payment\Plugin\Payment\Status\PaymentStatusInterface|null $previous_payment_status: The payment's previous status or NULL if there is none.

Overrides EventDispatcherInterface::setPaymentStatus

File

src/EventDispatcherCollection.php, line 50

Class

EventDispatcherCollection
Dispatches events to a collection of event dispatchers.

Namespace

Drupal\payment

Code

public function setPaymentStatus(PaymentInterface $payment, PaymentStatusInterface $previous_payment_status = NULL) {
  foreach ($this->eventDispatchers as $event_dispatcher) {
    $event_dispatcher
      ->setPaymentStatus($payment, $previous_payment_status);
  }
}