You are here

public function License::getTypePlugin in Commerce License 8.2

Get an unconfigured instance of the associated license type plugin.

Return value

\Drupal\commerce_license\Plugin\Commerce\LicenseType\LicenseTypeInterface An unconfigured instance of the associated license type plugin.

Overrides LicenseInterface::getTypePlugin

File

src/Entity/License.php, line 148

Class

License
Defines the License entity.

Namespace

Drupal\commerce_license\Entity

Code

public function getTypePlugin() {

  /** @var \Drupal\commerce_license\LicenseTypeManager $license_type_manager */
  $license_type_manager = \Drupal::service('plugin.manager.commerce_license_type');
  return $license_type_manager
    ->createInstance($this
    ->bundle());
}