You are here

class PaymentQueuePaymentIdsAlter in Payment 8.2

Provides an event that alters \Drupal\payment\QueueInterface::loadPaymentIds() results.

Hierarchy

Expanded class hierarchy of PaymentQueuePaymentIdsAlter

See also

\Drupal\payment\Event\PaymentEvents::PAYMENT_QUEUE_PAYMENT_IDS_ALTER

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

File

src/Event/PaymentQueuePaymentIdsAlter.php, line 13

Namespace

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

  /**
   * The queue category ID.
   *
   * @var string
   */
  protected $categoryId;

  /**
   * The ID of the user that must own the payments.
   *
   * @var int
   */
  protected $ownerId;

  /**
   * The IDs of available payments as loaded by the queue.
   *
   * @var int[]
   */
  protected $paymentIds;

  /**
   * The queue ID.
   *
   * @var string
   */
  protected $queueId;

  /**-
   * Constructs a new instance.
   *
   * @param string $queue_id
   *   The queue ID.
   * @param string $category_id
   *   The queue category ID.
   * @param int $owner_id
   *   The ID of the user that must own the paymnets.
   * @param int[] $payment_ids
   *   The IDs of available payments as loaded by the queue.
   */
  public function __construct($queue_id, $category_id, $owner_id, array $payment_ids) {
    $this->categoryId = $category_id;
    $this->ownerId = $owner_id;
    $this->paymentIds = $payment_ids;
    $this->queueId = $queue_id;
  }

  /**
   * Gets the queue ID.
   *
   * @return string
   */
  public function getQueueId() {
    return $this->queueId;
  }

  /**
   * Gets the queue category ID.
   *
   * @return string
   */
  public function getCategoryId() {
    return $this->categoryId;
  }

  /**
   * Gets the ID of the user who owns the payments.
   *
   * @return int
   */
  public function getOwnerId() {
    return $this->ownerId;
  }

  /**
   * Gets the IDs of the available payments.
   *
   * @return int[]
   */
  public function getPaymentIds() {
    return $this->paymentIds;
  }

  /**
   * Sets the IDs of the available payments.
   *
   * @param int[] $payment_ids
   *
   * @return $this
   */
  public function setPaymentIds(array $payment_ids) {
    $this->paymentIds = $payment_ids;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PaymentQueuePaymentIdsAlter::$categoryId protected property The queue category ID.
PaymentQueuePaymentIdsAlter::$ownerId protected property The ID of the user that must own the payments.
PaymentQueuePaymentIdsAlter::$paymentIds protected property The IDs of available payments as loaded by the queue.
PaymentQueuePaymentIdsAlter::$queueId protected property The queue ID.
PaymentQueuePaymentIdsAlter::getCategoryId public function Gets the queue category ID.
PaymentQueuePaymentIdsAlter::getOwnerId public function Gets the ID of the user who owns the payments.
PaymentQueuePaymentIdsAlter::getPaymentIds public function Gets the IDs of the available payments.
PaymentQueuePaymentIdsAlter::getQueueId public function Gets the queue ID.
PaymentQueuePaymentIdsAlter::setPaymentIds public function Sets the IDs of the available payments.
PaymentQueuePaymentIdsAlter::__construct public function