You are here

public static function CoreStockEvents::mapStockEventIds in Commerce Stock 8

To ensure backwards compatibility we introduced StockEventTypes plugins without changing the StockEventsInterface. This functions maps the interface constants to StockEventTypes.

Parameters

string $stock_event_type_id: The StockEventType id.

Return value

int The StockEventsInterface interface constant or FALSE if it not exists.

1 call to CoreStockEvents::mapStockEventIds()
OrderEventSubscriber::runTransactionEvent in src/EventSubscriber/OrderEventSubscriber.php
Run the transaction event.

File

src/Plugin/StockEvents/CoreStockEvents.php, line 127

Class

CoreStockEvents
Core Stock Events.

Namespace

Drupal\commerce_stock\Plugin\StockEvents

Code

public static function mapStockEventIds($stock_event_type_id) {
  $map = array_flip(self::getEventTypeMap());
  $result = array_key_exists($stock_event_type_id, $map) ? $map[$stock_event_type_id] : FALSE;
  return $result;
}