public static function CoreStockEvents::mapStockEventTypes 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
int $event_type_id: The StockEventsInterface interface constant.
Return value
string The StockEventType id or FALSE if not exists.
File
- src/
Plugin/ StockEvents/ CoreStockEvents.php, line 110
Class
- CoreStockEvents
- Core Stock Events.
Namespace
Drupal\commerce_stock\Plugin\StockEventsCode
public static function mapStockEventTypes($event_type_id) {
$map = self::getEventTypeMap();
$result = array_key_exists($event_type_id, $map) ? $map[$event_type_id] : FALSE;
return $result;
}