modules/acm_sku/src/AcquiaCommerce/SKUPluginManager.php
public function pluginFromSku(SKU $sku) {
    if (empty($sku)) {
      return NULL;
    }

    $bundle = $sku->getType();

    if (empty($bundle)) {
      return NULL;
    }

    $plugin = NULL;

    try {
      $plugin = $this->getDefinition($bundle);
    }
    catch (PluginNotFoundException $exception) {
      \Drupal::logger('acm_sku')->notice(t("Bundle @bundle doesn't appear to
        have an implementation, please check the plugin id on your implementation
        of the SKU plugin", ['@bundle' => $bundle]));
    } finally {
      return $plugin;
    }
  }
public function pluginFromSku(SKU $sku) {
    if (empty($sku)) {
      return NULL;
    }

    $bundle = $sku->getType();

    if (empty($bundle)) {
      return NULL;
    }

    $plugin = NULL;

    try {
      $plugin = $this->getDefinition($bundle);
    }
    catch (PluginNotFoundException $exception) {
      \Drupal::logger('acm_sku')->notice(t("Bundle @bundle doesn't appear to
        have an implementation, please check the plugin id on your implementation
        of the SKU plugin", ['@bundle' => $bundle]));
    } finally {
      return $plugin;
    }
  }
public function pluginFromSku ( SKU $ sku ) { if ( empty ( $ sku ) ) { return NULL ; } $ bundle = $ sku -> getType ( ) ; if ( empty ( $ bundle ) ) { return NULL ; } $ plugin = NULL ; try { $ plugin = $ this -> getDefinition ( $ bundle ) ; } catch ( PluginNotFoundException $ exception ) { \ Drupal :: logger ( 'acm_sku' ) -> notice ( t ( "Bundle @bundle doesn't appear to
        have an implementation, please check the plugin id on your implementation
        of the SKU plugin" , [ '@bundle' => $ bundle ] ) ) ; } finally { return $ plugin ; } }
Takes a SKU entity and checks it for a matching plugin.

@param \Drupal\acm_sku\Entity\SKU $sku
The SKU to check for a plugin.

@return array|null
Returns the plugin definition if found, otherwise returns NULL.
Takes a SKU entity and checks it for a matching plugin .