You are here

protected function LogTemplateManager::getCategoryLabels in Commerce Core 8.2

Gets a list of category labels for the given entity type ID.

Parameters

string $entity_type_id: The entity type ID.

Return value

array A list of categories labels keyed by ID.

1 call to LogTemplateManager::getCategoryLabels()
LogTemplateManager::getLabelsByCategory in modules/log/src/LogTemplateManager.php
Gets the log template labels grouped by category.

File

modules/log/src/LogTemplateManager.php, line 136

Class

LogTemplateManager
Manages discovery and instantiation of commerce_log_template plugins.

Namespace

Drupal\commerce_log

Code

protected function getCategoryLabels($entity_type_id = NULL) {
  $category_definitions = $this->categoryManager
    ->getDefinitionsByEntityType($entity_type_id);
  $category_labels = array_map(function ($category_definition) {
    return (string) $category_definition['label'];
  }, $category_definitions);
  natcasesort($category_labels);
  return $category_labels;
}