alterInfo example


  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/CKEditor4To5Upgrade', $namespaces$module_handler, CKEditor4To5UpgradePluginInterface::class, CKEditor4To5Upgrade::class);

    $this->alterInfo('ckeditor4to5upgrade_plugin_info');
    $this->setCacheBackend($cache_backend, 'ckeditor4to5upgrade_plugins');
  }

  /** * Validates plugin definitions: avoids conflicts. Builds maps for later use. */
  protected function validateAndBuildMaps(): void {
    if ($this->cke4ButtonsMap !== NULL) {
      return;
    }

    

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/Editor', $namespaces$module_handler, 'Drupal\editor\Plugin\EditorPluginInterface', 'Drupal\editor\Annotation\Editor');
    $this->alterInfo('editor_info');
    $this->setCacheBackend($cache_backend, 'editor_plugins');
  }

  /** * Populates a key-value pair of available text editors. * * @return array * An array of translated text editor labels, keyed by ID. */
  public function listOptions() {
    $options = [];
    

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ContextHandlerInterface $context_handler) {
    parent::__construct('Plugin/SectionStorage', $namespaces$module_handler, SectionStorageInterface::class, SectionStorage::class);

    $this->contextHandler = $context_handler;

    $this->alterInfo('layout_builder_section_storage');
    $this->setCacheBackend($cache_backend, 'layout_builder_section_storage_plugins');
  }

  /** * {@inheritdoc} */
  protected function findDefinitions() {
    $definitions = parent::findDefinitions();

    // Sort the definitions by their weight while preserving the original order     // for those with matching weights.

  public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, TranslationInterface $string_translation, ClassResolverInterface $class_resolver, EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_repository) {
    parent::__construct('Entity', $namespaces$module_handler, 'Drupal\Core\Entity\EntityInterface');

    $this->setCacheBackend($cache, 'entity_type', ['entity_types']);
    $this->alterInfo('entity_type');

    $this->discovery = new AnnotatedClassDiscovery('Entity', $namespaces, 'Drupal\Core\Entity\Annotation\EntityType');
    $this->stringTranslation = $string_translation;
    $this->classResolver = $class_resolver;
    $this->entityLastInstalledSchemaRepository = $entity_last_installed_schema_repository;
  }

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

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, FileSystemInterface $file_system) {
    parent::__construct('Plugin/Archiver', $namespaces$module_handler, 'Drupal\Core\Archiver\ArchiverInterface', 'Drupal\Core\Archiver\Annotation\Archiver');
    $this->alterInfo('archiver_info');
    $this->setCacheBackend($cache_backend, 'archiver_info_plugins');
    $this->fileSystem = $file_system;
  }

  /** * {@inheritdoc} */
  public function createInstance($plugin_id, array $configuration = []) {
    $plugin_definition = $this->getDefinition($plugin_id);
    $plugin_class = DefaultFactory::getPluginClass($plugin_id$plugin_definition, 'Drupal\Core\Archiver\ArchiverInterface');
    return new $plugin_class($this->fileSystem->realpath($configuration['filepath'])$configuration);
  }

  public function __construct(ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager) {
    $this->factory = new ContainerFactory($this$this->pluginInterface);
    $this->alterInfo('migration_plugins');
    $this->setCacheBackend($cache_backend, 'migration_plugins', ['migration_plugins']);
    $this->moduleHandler = $module_handler;
  }

  /** * Gets the plugin discovery. * * This method overrides DefaultPluginManager::getDiscovery() in order to * search for migration configurations in the MODULENAME/migrations * directory. */
  

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, LoggerInterface $logger) {
    parent::__construct('Plugin/Block', $namespaces$module_handler, 'Drupal\Core\Block\BlockPluginInterface', 'Drupal\Core\Block\Annotation\Block');

    $this->alterInfo($this->getType());
    $this->setCacheBackend($cache_backend, 'block_plugins');
    $this->logger = $logger;
  }

  /** * {@inheritdoc} */
  protected function getType() {
    return 'block';
  }

  

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/media/Source', $namespaces$module_handler, MediaSourceInterface::class, MediaSource::class);

    $this->alterInfo('media_source_info');
    $this->setCacheBackend($cache_backend, 'media_source_plugins');
  }

}

class SelectionPluginManager extends DefaultPluginManager implements SelectionPluginManagerInterface, FallbackPluginManagerInterface {

  /** * {@inheritdoc} */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    $this->alterInfo('entity_reference_selection');
    $this->setCacheBackend($cache_backend, 'entity_reference_selection_plugins');

    parent::__construct('Plugin/EntityReferenceSelection', $namespaces$module_handler, 'Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface', 'Drupal\Core\Entity\Annotation\EntityReferenceSelection');
  }

  /** * {@inheritdoc} */
  public function getInstance(array $options) {
    if (!isset($options['target_type'])) {
      throw new \InvalidArgumentException("Missing required 'target_type' property for a EntityReferenceSelection plugin.");
    }

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/Filter', $namespaces$module_handler, 'Drupal\filter\Plugin\FilterInterface', 'Drupal\filter\Annotation\Filter');
    $this->alterInfo('filter_info');
    $this->setCacheBackend($cache_backend, 'filter_plugins');
  }

  /** * {@inheritdoc} */
  public function getFallbackPluginId($plugin_id, array $configuration = []) {
    return 'filter_null';
  }

}

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, LoggerInterface $logger, ImageToolkitManager $toolkit_manager) {
    parent::__construct('Plugin/ImageToolkit/Operation', $namespaces$module_handler, 'Drupal\Core\ImageToolkit\ImageToolkitOperationInterface', 'Drupal\Core\ImageToolkit\Annotation\ImageToolkitOperation');

    $this->alterInfo('image_toolkit_operation');
    $this->setCacheBackend($cache_backend, 'image_toolkit_operation_plugins');
    $this->logger = $logger;
    $this->toolkitManager = $toolkit_manager;
  }

  /** * Returns the plugin ID for a given toolkit and operation. * * @param \Drupal\Core\ImageToolkit\ImageToolkitInterface $toolkit * The toolkit instance. * @param string $operation * The operation (e.g. "crop"). * * @return string * The plugin ID. * * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * When no plugin is available. */

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/WorkflowType', $namespaces$module_handler, WorkflowTypeInterface::class, WorkflowType::class);
    $this->alterInfo('workflow_type_info');
    $this->setCacheBackend($cache_backend, 'workflow_type_info');
  }

}

  public function __construct(ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, CacheBackendInterface $cache_backend$root) {
    // Note that the parent construct is not called because this not use     // annotated class discovery.     $this->moduleHandler = $module_handler;
    $this->themeHandler = $theme_handler;
    $this->alterInfo('help_topics_info');
    // Use the 'config:core.extension' cache tag so the plugin cache is     // invalidated on theme install and uninstall.     $this->setCacheBackend($cache_backend, 'help_topics', ['config:core.extension']);
    $this->root = (string) $root;
  }

  /** * {@inheritdoc} */
  protected function getDiscovery() {
    if (!isset($this->discovery)) {
      

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    $this->alterInfo('condition_info');
    $this->setCacheBackend($cache_backend, 'condition_plugins');

    parent::__construct('Plugin/Condition', $namespaces$module_handler, 'Drupal\Core\Condition\ConditionInterface', 'Drupal\Core\Condition\Annotation\Condition');
  }

  /** * {@inheritdoc} */
  protected function getType() {
    return 'condition';
  }

  

  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/QueueWorker', $namespaces$module_handler, 'Drupal\Core\Queue\QueueWorkerInterface', 'Drupal\Core\Annotation\QueueWorker');

    $this->setCacheBackend($cache_backend, 'queue_plugins');
    $this->alterInfo('queue_info');
  }

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

    // Safeguard to ensure the default lease time is used in the case of a     // malformed queue worker annotation where cron is specified without a time,     // or an invalid time is provided.
Home | Imprint | This part of the site doesn't use cookies.