You are here

public function Promotion::getOrderTypeIds in Commerce Core 8.2

Gets the promotion order type IDs.

Return value

int[] The promotion order type IDs.

Overrides PromotionInterface::getOrderTypeIds

1 call to Promotion::getOrderTypeIds()
Promotion::available in modules/promotion/src/Entity/Promotion.php
Checks whether the promotion is available for the given order.

File

modules/promotion/src/Entity/Promotion.php, line 198

Class

Promotion
Defines the promotion entity class.

Namespace

Drupal\commerce_promotion\Entity

Code

public function getOrderTypeIds() {
  $order_type_ids = [];
  foreach ($this
    ->get('order_types') as $field_item) {
    $order_type_ids[] = $field_item->target_id;
  }
  return $order_type_ids;
}