You are here

protected function PackageTypeManager::getDiscovery in Commerce Shipping 8.2

Gets the plugin discovery.

Return value

\Drupal\Component\Plugin\Discovery\DiscoveryInterface

Overrides DefaultPluginManager::getDiscovery

File

src/PackageTypeManager.php, line 55

Class

PackageTypeManager
Manages discovery and instantiation of package type plugins.

Namespace

Drupal\commerce_shipping

Code

protected function getDiscovery() {
  if (!isset($this->discovery)) {
    $this->discovery = new YamlDiscovery('commerce_package_types', $this->moduleHandler
      ->getModuleDirectories());
    $this->discovery
      ->addTranslatableProperty('label', 'label_context');
    $this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
  }
  return $this->discovery;
}