• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Plugin\DefaultPluginManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Drupal\Core\Plugin\DefaultPluginManager的典型用法代码示例。如果您正苦于以下问题:PHP DefaultPluginManager类的具体用法?PHP DefaultPluginManager怎么用?PHP DefaultPluginManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DefaultPluginManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructs the ImageToolkitManager object.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler.
  * @param \Drupal\Core\ImageToolkit\ImageToolkitOperationManagerInterface $operation_manager
  *   The toolkit operation manager.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, ImageToolkitOperationManagerInterface $operation_manager)
 {
     parent::__construct('Plugin/ImageToolkit', $namespaces, $module_handler, 'Drupal\\Core\\ImageToolkit\\Annotation\\ImageToolkit');
     $this->setCacheBackend($cache_backend, 'image_toolkit_plugins');
     $this->configFactory = $config_factory;
     $this->operationManager = $operation_manager;
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:22,代码来源:ImageToolkitManager.php


示例2: __construct

 /**
  * Constructs a MigratePluginManager object.
  *
  * @param string $type
  *   The type of the plugin: row, source, process, destination, entity_field,
  * id_map.
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  * @param string $annotation
  *   The annotation class name.
  */
 public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, $annotation = 'Drupal\\Component\\Annotation\\PluginID')
 {
     $plugin_interface = isset($plugin_interface_map[$type]) ? $plugin_interface_map[$type] : NULL;
     parent::__construct("Plugin/migrate/{$type}", $namespaces, $module_handler, $plugin_interface, $annotation);
     $this->alterInfo('migrate_' . $type . '_info');
     $this->setCacheBackend($cache_backend, 'migrate_plugins_' . $type);
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:23,代码来源:MigratePluginManager.php


示例3: createInstance

 /**
  * Overrides PluginManagerBase::createInstance().
  *
  * This method is overridden to set the request object when the resource
  * object is instantiated.
  */
 public function createInstance($plugin_id, array $configuration = array())
 {
     /* @var ResourceInterface $resource */
     $resource = parent::createInstance($plugin_id, $configuration);
     $resource->setRequest($this->request);
     return $resource;
 }
开发者ID:jhoffman-tm,项目名称:waldorf-deployment,代码行数:13,代码来源:ResourcePluginManager.php


示例4: __construct

 /**
  * Constructs a new instance.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory)
 {
     parent::__construct('Plugin/Currency/AmountFormatter', $namespaces, $module_handler, AmountFormatterInterface::class, CurrencyAmountFormatter::class);
     $this->alterInfo('currency_amount_formatter');
     $this->setCacheBackend($cache_backend, 'currency_amount_formatter');
     $this->configFactory = $config_factory;
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:20,代码来源:AmountFormatterManager.php


示例5: __construct

 /**
  * Constructs the MailManager object.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The configuration factory.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory)
 {
     parent::__construct('Plugin/Mail', $namespaces, $module_handler, 'Drupal\\Core\\Annotation\\Mail');
     $this->alterInfo('mail_backend_info');
     $this->setCacheBackend($cache_backend, 'mail_backend_plugins');
     $this->mailConfig = $config_factory->get('system.mail');
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:20,代码来源:MailManager.php


示例6: __construct

 /**
  * Constructs a new instance.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  * @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver
  *   The class_resolver.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ClassResolverInterface $class_resolver)
 {
     parent::__construct('Plugin/Payment/Method', $namespaces, $module_handler, PaymentMethodInterface::class, PaymentMethod::class);
     $this->alterInfo('payment_method');
     $this->setCacheBackend($cache_backend, 'payment_method', ['payment_method']);
     $this->classResolver = $class_resolver;
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:20,代码来源:PaymentMethodManager.php


示例7: __construct

 /**
  * Overrides \Drupal\Component\Plugin\PluginManagerBase::__construct().
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler)
 {
     parent::__construct('Plugin/Validation/Constraint', $namespaces, $module_handler);
     $this->discovery = new StaticDiscoveryDecorator($this->discovery, array($this, 'registerDefinitions'));
     $this->alterInfo('validation_constraint');
     $this->setCacheBackend($cache_backend, 'validation_constraint_plugins');
 }
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:18,代码来源:ConstraintManager.php


示例8: __construct

 /**
  * Constructs a CheckoutPaneManager object.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations,
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler)
 {
     parent::__construct('Plugin/Ubercart/CheckoutPane', $namespaces, $module_handler, CheckoutPanePluginInterface::class, CheckoutPane::class);
     $this->alterInfo('payment_method');
     $this->setCacheBackend($cache_backend, 'uc_checkout_panes');
     $this->paneConfig = \Drupal::config('uc_cart.settings')->get('panes');
 }
开发者ID:pedrocones,项目名称:hydrotools,代码行数:18,代码来源:CheckoutPaneManager.php


示例9: __construct

 /**
  * Constructs a new ZoneMemberManager.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cacheBackend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
  *   The module handler.
  * @param \Drupal\Component\Uuid\UuidInterface $uuidService
  *   The uuid service.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cacheBackend, ModuleHandlerInterface $moduleHandler, UuidInterface $uuidService)
 {
     parent::__construct('Plugin/ZoneMember', $namespaces, $moduleHandler, 'Drupal\\address\\Plugin\\ZoneMember\\ZoneMemberInterface', 'Drupal\\address\\Annotation\\ZoneMember');
     $this->alterInfo('zone_member_info');
     $this->setCacheBackend($cacheBackend, 'zone_member_plugins');
     $this->uuidService = $uuidService;
 }
开发者ID:jokas,项目名称:d8.dev,代码行数:20,代码来源:ZoneMemberManager.php


示例10: __construct

 /**
  * Constructs a AggregatorPluginManager object.
  *
  * @param string $type
  *   The plugin type, for example fetcher.
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler.
  */
 public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler)
 {
     $type_annotations = array('fetcher' => 'Drupal\\aggregator\\Annotation\\AggregatorFetcher', 'parser' => 'Drupal\\aggregator\\Annotation\\AggregatorParser', 'processor' => 'Drupal\\aggregator\\Annotation\\AggregatorProcessor');
     $plugin_interfaces = array('fetcher' => 'Drupal\\aggregator\\Plugin\\FetcherInterface', 'parser' => 'Drupal\\aggregator\\Plugin\\ParserInterface', 'processor' => 'Drupal\\aggregator\\Plugin\\ProcessorInterface');
     parent::__construct("Plugin/aggregator/{$type}", $namespaces, $module_handler, $plugin_interfaces[$type], $type_annotations[$type]);
     $this->setCacheBackend($cache_backend, 'aggregator_' . $type . '_plugins');
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:20,代码来源:AggregatorPluginManager.php


示例11: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     if (!isset($definition['list_class'])) {
         $definition['list_class'] = '\\Drupal\\Core\\Field\\FieldItemList';
     }
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:10,代码来源:FieldTypePluginManager.php


示例12: __construct

 /**
  * Constructs the ImageToolkitOperationManager object.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  * @param \Psr\Log\LoggerInterface $logger
  *   A logger instance.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, LoggerInterface $logger)
 {
     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;
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:20,代码来源:ImageToolkitOperationManager.php


示例13: __construct

 /**
  * Creates the discovery object.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler)
 {
     // We replace the $subdir parameter with our own value.
     // This tells the plugin system to look for plugins in the 'Plugin/Sandwich'
     // subfolder inside modules' 'src' folder.
     $subdir = 'Plugin/Sandwich';
     // The name of the interface that plugins should adhere to.  Drupal will
     // enforce this as a requirement.  If a plugin does not implement this
     // interface, than Drupal will throw an error.
     $plugin_interface = 'Drupal\\plugin_type_example\\SandwichInterface';
     // The name of the annotation class that contains the plugin definition.
     $plugin_definition_annotation_name = 'Drupal\\Component\\Annotation\\Plugin';
     parent::__construct($subdir, $namespaces, $module_handler, $plugin_interface, $plugin_definition_annotation_name);
     // This allows the plugin definitions to be altered by an alter hook. The
     // parameter defines the name of the hook, thus: hook_sandwich_info_alter().
     // In this example, we implement this hook to change the plugin definitions:
     // see plugin_type_example_sandwich_info_alter().
     $this->alterInfo('sandwich_info');
     // This sets the caching method for our plugin definitions.  Plugin
     // definitions are cached using the provided cache backend.  For our
     // Sandwich plugin type, we've specified the @cache.default service be used
     // in the plugin_type_example.services.yml file.  The second argument is a
     // cache key prefix.  Out of the box Drupal with the default cache backend
     // setup will store our plugin definition in the cache_default table using
     // the sandwich_info key.  All that is implementation details however,
     // all we care about it that caching for our plugin definition is taken
     // care of by this call.
     $this->setCacheBackend($cache_backend, 'sandwich_info');
 }
开发者ID:seongbae,项目名称:drumo-distribution,代码行数:40,代码来源:SandwichPluginManager.php


示例14: __construct

 /**
  * Constructs a FormatterPluginManager object.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler.
  * @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager
  *   The 'field type' plugin manager.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, FieldTypePluginManagerInterface $field_type_manager)
 {
     parent::__construct('Plugin/Field/FieldFormatter', $namespaces, $module_handler, 'Drupal\\Core\\Field\\FormatterInterface', 'Drupal\\Core\\Field\\Annotation\\FieldFormatter');
     $this->setCacheBackend($cache_backend, 'field_formatter_types_plugins');
     $this->alterInfo('field_formatter_info');
     $this->fieldTypeManager = $field_type_manager;
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:20,代码来源:FormatterPluginManager.php


示例15: __construct

 /**
  * Constructs a new instance.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  * @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver
  *   The class resolver.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ClassResolverInterface $class_resolver)
 {
     parent::__construct('Plugin/Currency/ExchangeRateProvider', $namespaces, $module_handler, ExchangeRateProviderInterface::class, CurrencyExchangeRateProvider::class);
     $this->alterInfo('currency_exchange_rate_provider');
     $this->setCacheBackend($cache_backend, 'currency_exchange_rate_provider');
     $this->classResolver = $class_resolver;
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:20,代码来源:ExchangeRateProviderManager.php


示例16: __construct

 /**
  * Constructs a PanelsStorageManager.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  * @param \Drupal\Core\Session\AccountProxyInterface $current_user
  *   The current user service.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, AccountProxyInterface $current_user)
 {
     parent::__construct('Plugin/PanelsStorage', $namespaces, $module_handler, PanelsStorageInterface::class, PanelsStorage::class);
     $this->currentUser = $current_user;
     $this->alterInfo('panels_storage_info');
     $this->setCacheBackend($cache_backend, 'panels_storage');
 }
开发者ID:ns-oxit-study,项目名称:drupal-8-training,代码行数:20,代码来源:PanelsStorageManager.php


示例17: createInstance

 /**
  * {@inheritdoc}
  */
 public function createInstance($plugin_id, array $configuration = [])
 {
     if (!$this->isPluginSupported($plugin_id)) {
         $plugin_id = $this->getFallbackPluginId($plugin_id);
     }
     return parent::createInstance($plugin_id, $configuration);
 }
开发者ID:sgtsaughter,项目名称:d8portfolio,代码行数:10,代码来源:DevelDumperPluginManager.php


示例18: findDefinitions

 /**
  * {@inheritdoc}
  */
 protected function findDefinitions()
 {
     $definitions = parent::findDefinitions();
     // Sort definitions by weight
     uasort($definitions, array('Drupal\\Component\\Utility\\SortArray', 'sortByWeightElement'));
     return $definitions;
 }
开发者ID:itk-google-glass,项目名称:brilleappen-drupal,代码行数:10,代码来源:ImcePluginManager.php


示例19: __construct

 /**
  * Constructs a ProcessorPluginManager object.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler.
  * @param \Drupal\Core\StringTranslation\TranslationInterface $translation
  *   The string translation manager.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, TranslationInterface $translation)
 {
     parent::__construct('Plugin/search_api/processor', $namespaces, $module_handler, 'Drupal\\search_api\\Processor\\ProcessorInterface', 'Drupal\\search_api\\Annotation\\SearchApiProcessor');
     $this->setCacheBackend($cache_backend, 'search_api_processors');
     $this->alterInfo('search_api_processor_info');
     $this->setStringTranslation($translation);
 }
开发者ID:curveagency,项目名称:intranet,代码行数:20,代码来源:ProcessorPluginManager.php


示例20: getDiscovery

 /**
  * {@inheritdoc}
  */
 protected function getDiscovery()
 {
     if (!isset($this->discovery)) {
         $this->discovery = parent::getDiscovery();
         $this->discovery = new StaticDiscoveryDecorator($this->discovery, [$this, 'registerDefinitions']);
     }
     return $this->discovery;
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:11,代码来源:ConstraintManager.php



注:本文中的Drupal\Core\Plugin\DefaultPluginManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Plugin\PluginBase类代码示例发布时间:2022-05-23
下一篇:
PHP Lock\LockBackendInterface类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap