function CategorizingPluginManagerTrait::getProviderName

Same name in other branches
  1. 9 core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php \Drupal\Core\Plugin\CategorizingPluginManagerTrait::getProviderName()
  2. 8.9.x core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php \Drupal\Core\Plugin\CategorizingPluginManagerTrait::getProviderName()
  3. 11.x core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php \Drupal\Core\Plugin\CategorizingPluginManagerTrait::getProviderName()

Gets the name of a provider.

Parameters

string $provider: The machine name of a plugin provider.

Return value

string The human-readable module name if it exists, otherwise the machine-readable name passed.

1 call to CategorizingPluginManagerTrait::getProviderName()
CategorizingPluginManagerTrait::processDefinitionCategory in core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php
Processes a plugin definition to ensure there is a category.

File

core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php, line 50

Class

CategorizingPluginManagerTrait
Provides a trait for the CategorizingPluginManagerInterface.

Namespace

Drupal\Core\Plugin

Code

protected function getProviderName($provider) {
    try {
        return $this->getModuleExtensionList()
            ->getName($provider);
    } catch (UnknownExtensionException $e) {
        // Otherwise, return the machine name.
        return $provider;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.