ProviderFilterDecorator example

return [$directory . '/migrations'];
      }$this->moduleHandler->getModuleDirectories());

      $yaml_discovery = new YamlDirectoryDiscovery($directories, 'migrate');
      // This gets rid of migrations which try to use a non-existent source       // plugin. The common case for this is if the source plugin has, or       // specifies, a non-existent provider.       $only_with_source_discovery = new NoSourcePluginDecorator($yaml_discovery);
      // This gets rid of migrations with explicit providers set if one of the       // providers do not exist before we try to use a potentially non-existing       // deriver. This is a rare case.       $filtered_discovery = new ProviderFilterDecorator($only_with_source_discovery[$this->moduleHandler, 'moduleExists']);
      $this->discovery = new ContainerDerivativeDiscoveryDecorator($filtered_discovery);
    }
    return $this->discovery;
  }

  /** * {@inheritdoc} */
  public function createInstance($plugin_id, array $configuration = []) {
    $instances = $this->createInstances([$plugin_id][$plugin_id => $configuration]);
    return reset($instances);
  }
Home | Imprint | This part of the site doesn't use cookies.