You are here

class RecurringOrderProcessor in Commerce Recurring Framework 8

Refreshes draft recurring orders.

Hierarchy

Expanded class hierarchy of RecurringOrderProcessor

1 string reference to 'RecurringOrderProcessor'
commerce_recurring.services.yml in ./commerce_recurring.services.yml
commerce_recurring.services.yml
1 service uses RecurringOrderProcessor
commerce_recurring.recurring_order_processor in ./commerce_recurring.services.yml
Drupal\commerce_recurring\RecurringOrderProcessor

File

src/RecurringOrderProcessor.php, line 11

Namespace

Drupal\commerce_recurring
View source
class RecurringOrderProcessor implements OrderProcessorInterface {

  /**
   * The recurring order manager.
   *
   * @var \Drupal\commerce_recurring\RecurringOrderManagerInterface
   */
  protected $recurringOrderManager;

  /**
   * Constructs a new RecurringOrderProcessor object.
   *
   * @param \Drupal\commerce_recurring\RecurringOrderManagerInterface $recurring_order_manager
   *   The recurring order manager.
   */
  public function __construct(RecurringOrderManagerInterface $recurring_order_manager) {
    $this->recurringOrderManager = $recurring_order_manager;
  }

  /**
   * {@inheritdoc}
   */
  public function process(OrderInterface $order) {
    if ($order
      ->bundle() == 'recurring') {
      $this->recurringOrderManager
        ->refreshOrder($order);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RecurringOrderProcessor::$recurringOrderManager protected property The recurring order manager.
RecurringOrderProcessor::process public function Processes an order. Overrides OrderProcessorInterface::process
RecurringOrderProcessor::__construct public function Constructs a new RecurringOrderProcessor object.