class SymfonyEventDispatcher in Payment 8.2
Dispatches Payment events through Symfony's event dispatcher.
Hierarchy
- class \Drupal\payment\SymfonyEventDispatcher implements EventDispatcherInterface
Expanded class hierarchy of SymfonyEventDispatcher
2 files declare their use of SymfonyEventDispatcher
- EventDispatcherCollectionTest.php in tests/
src/ Unit/ EventDispatcherCollectionTest.php - SymfonyEventDispatcherTest.php in tests/
src/ Unit/ SymfonyEventDispatcherTest.php
1 string reference to 'SymfonyEventDispatcher'
1 service uses SymfonyEventDispatcher
File
- src/
SymfonyEventDispatcher.php, line 22
Namespace
Drupal\paymentView source
class SymfonyEventDispatcher implements EventDispatcherInterface {
/**
* The Symfony event dispatcher.
*
* @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
*/
protected $symfonyEventDispatcher;
/**
* Constructs a new instance.
*
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $symfony_event_dispatcher
*/
public function __construct(SymfonyEventDispatcherInterface $symfony_event_dispatcher) {
$this->symfonyEventDispatcher = $symfony_event_dispatcher;
}
/**
* {@inheritdoc}
*/
public function alterQueueLoadedPaymentIds($queue_id, $category_id, $owner_id, array $payment_ids) {
$event = new PaymentQueuePaymentIdsAlter($queue_id, $category_id, $owner_id, $payment_ids);
$this->symfonyEventDispatcher
->dispatch(PaymentEvents::PAYMENT_QUEUE_PAYMENT_IDS_ALTER, $event);
$payment_ids = $event
->getPaymentIds();
return $payment_ids;
}
/**
* {@inheritdoc}
*/
public function setPaymentStatus(PaymentInterface $payment, PaymentStatusInterface $previous_payment_status = NULL) {
$event = new PaymentStatusSet($payment, $previous_payment_status);
$this->symfonyEventDispatcher
->dispatch(PaymentEvents::PAYMENT_STATUS_SET, $event);
}
/**
* {@inheritdoc}
*
*/
public function preExecutePayment(PaymentInterface $payment) {
$event = new PaymentPreExecute($payment);
$this->symfonyEventDispatcher
->dispatch(PaymentEvents::PAYMENT_PRE_EXECUTE, $event);
}
/**
* {@inheritdoc}
*/
public function executePaymentAccess(PaymentInterface $payment, PaymentMethodInterface $payment_method, AccountInterface $account) {
$event = new PaymentExecuteAccess($payment, $payment_method, $account);
$this->symfonyEventDispatcher
->dispatch(PaymentEvents::PAYMENT_EXECUTE_ACCESS, $event);
return $event
->getAccessResult();
}
/**
* {@inheritdoc}
*
*/
public function preCapturePayment(PaymentInterface $payment) {
$event = new PaymentPreCapture($payment);
$this->symfonyEventDispatcher
->dispatch(PaymentEvents::PAYMENT_PRE_CAPTURE, $event);
}
/**
* {@inheritdoc}
*
*/
public function preRefundPayment(PaymentInterface $payment) {
$event = new PaymentPreRefund($payment);
$this->symfonyEventDispatcher
->dispatch(PaymentEvents::PAYMENT_PRE_REFUND, $event);
}
/**
* {@inheritdoc}
*/
public function preResumeContext(PaymentInterface $payment) {
$event = new PaymentTypePreResumeContext($payment);
$this->symfonyEventDispatcher
->dispatch(PaymentEvents::PAYMENT_TYPE_PRE_RESUME_CONTEXT, $event);
}
}