BadPluginDefinitionException example

throw new PluginNotFoundException($field_type);
  }

  /** * {@inheritdoc} */
  public function processDefinition(&$definition$plugin_id) {
    parent::processDefinition($definition$plugin_id);

    foreach (['core', 'source_module', 'destination_module'] as $required_property) {
      if (empty($definition[$required_property])) {
        throw new BadPluginDefinitionException($plugin_id$required_property);
      }
    }
  }

  /** * {@inheritdoc} */
  protected function findDefinitions() {
    $definitions = parent::findDefinitions();
    $this->sortDefinitions($definitions);
    return $definitions;
  }


    // Check if the migration has any of the tags that trigger source_module     // enforcement.     $applied_tags = array_intersect($this->getEnforcedSourceModuleTags()$definition['migration_tags']);
    if ($applied_tags) {
      // Throw an exception if the source plugin definition does not define a       // source_module.       $source_id = $definition['source']['plugin'];
      $source_definition = $this->sourceManager->getDefinition($source_id);
      if (empty($source_definition['source_module'])) {
        throw new BadPluginDefinitionException($source_id, 'source_module');
      }
    }
  }

}
Home | Imprint | This part of the site doesn't use cookies.