You are here

protected function RecurringOrderManager::getOrderItemTypeId in Commerce Recurring Framework 8

Gets the order item type ID for the given subscription.

Parameters

\Drupal\commerce_recurring\Entity\SubscriptionInterface $subscription: The subscription.

Return value

string The order item type ID.

1 call to RecurringOrderManager::getOrderItemTypeId()
RecurringOrderManager::applyCharges in src/RecurringOrderManager.php
Applies subscription charges to the given recurring order.

File

src/RecurringOrderManager.php, line 364

Class

RecurringOrderManager
Provides the default recurring order manager.

Namespace

Drupal\commerce_recurring

Code

protected function getOrderItemTypeId(SubscriptionInterface $subscription) {
  if ($purchasable_entity_type_id = $subscription
    ->getType()
    ->getPurchasableEntityTypeId()) {
    return 'recurring_' . str_replace('commerce_', '', $purchasable_entity_type_id);
  }
  else {
    return 'recurring_standalone';
  }
}