本文整理汇总了PHP中Drupal\Core\Plugin\PluginBase类的典型用法代码示例。如果您正苦于以下问题:PHP PluginBase类的具体用法?PHP PluginBase怎么用?PHP PluginBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructs a PluginBase object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->definition = $plugin_definition + $configuration;
}
开发者ID:nsp15,项目名称:Drupal8,代码行数:15,代码来源:PluginBase.php
示例2: __construct
/**
* Constructs a new SelectionBase object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager service.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler service.
* @param \Drupal\Core\Session\AccountInterface $current_user
* The current user.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityManager = $entity_manager;
$this->moduleHandler = $module_handler;
$this->currentUser = $current_user;
}
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:23,代码来源:ViewsSelection.php
示例3: __construct
/**
* Default constructor
*/
public function __construct(array $configuration, $pluginId, $pluginDefinition)
{
parent::__construct($configuration, $pluginId, $pluginDefinition);
if (isset($configuration['settings'])) {
$this->settings = (array) $configuration['settings'];
}
}
开发者ID:makinacorpus,项目名称:drupal-sf-dic,代码行数:10,代码来源:FilterBase.php
示例4: __construct
/**
* Constructs a NodeAliasType instance.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler service.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager service.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager service.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager, EntityManagerInterface $entity_manager)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->moduleHandler = $module_handler;
$this->languageManager = $language_manager;
$this->entityManager = $entity_manager;
}
开发者ID:dev981,项目名称:gaptest,代码行数:23,代码来源:EntityAliasTypeBase.php
示例5: __construct
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->query = $this->configuration['query'];
$this->facet = $this->configuration['facet'];
$this->results = !empty($this->configuration['results']) ? $this->configuration['results'] : array();
}
开发者ID:nB-MDSO,项目名称:mdso-d8blog,代码行数:10,代码来源:QueryTypePluginBase.php
示例6: __construct
/**
* Constructs a new instance.
*
* @param mixed[] $configuration
* @param string $plugin_id
* @param mixed[] $plugin_definition
* @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
* The string translator.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, TranslationInterface $string_translation, ModuleHandlerInterface $module_handler)
{
$configuration += $this->defaultConfiguration();
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->moduleHandler = $module_handler;
$this->stringTranslation = $string_translation;
}
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:18,代码来源:PaymentMethodConfigurationBase.php
示例7: __construct
/**
* Constructs widget plugin.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
* Event dispatcher service.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EventDispatcherInterface $event_dispatcher, EntityManagerInterface $entity_manager)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->eventDispatcher = $event_dispatcher;
$this->entityManager = $entity_manager;
$this->setConfiguration($configuration);
}
开发者ID:nB-MDSO,项目名称:mdso-d8blog,代码行数:19,代码来源:WidgetBase.php
示例8: __construct
/**
* Constructs an ImageToolkitBase object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\ImageToolkit\ImageToolkitOperationManagerInterface $operation_manager
* The toolkit operation manager.
* @param \Psr\Log\LoggerInterface $logger
* A logger instance.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, ImageToolkitOperationManagerInterface $operation_manager, LoggerInterface $logger, ConfigFactoryInterface $config_factory)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->operationManager = $operation_manager;
$this->logger = $logger;
$this->configFactory = $config_factory;
}
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:23,代码来源:ImageToolkitBase.php
示例9: __construct
public function __construct(array $configuration, $plugin_id, $plugin_definition, DatabaseConnection $db, TargetInterface $target = NULL)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->db = $db;
if ($target) {
$this->bind($target);
}
}
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:8,代码来源:IndexerBase.php
示例10: __construct
/**
* Constructs a new instance.
*
* @param mixed[] $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed[] $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Extension\ModuleHandlerInterface
* @param \Drupal\payment\Plugin\Payment\Status\PaymentStatusManagerInterface $payment_status_manager
* @param \Drupal\Core\Datetime\DrupalDateTime $default_datetime
* The default datetime of the new status.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, ModuleHandlerInterface $module_handler, PaymentStatusManagerInterface $payment_status_manager, DrupalDateTime $default_datetime)
{
$configuration += $this->defaultConfiguration();
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->defaultDateTime = $default_datetime;
$this->moduleHandler = $module_handler;
$this->paymentStatusManager = $payment_status_manager;
}
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:22,代码来源:PaymentStatusBase.php
示例11: __construct
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition)
{
if (!isset($configuration['theme'])) {
$configuration['theme'] = Bootstrap::getTheme();
}
$this->theme = $configuration['theme'];
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
开发者ID:r-daneelolivaw,项目名称:chalk,代码行数:11,代码来源:PluginBase.php
示例12: __construct
/**
* {@inheritdoc}
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Drupal\printable\PrintableCssIncludeInterface $printable_css_include
* The printable CSS include manager.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, ConfigFactoryInterface $config_factory, PrintableCssIncludeInterface $printable_css_include, LinkExtractorInterface $link_extractor)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->configFactory = $config_factory;
$this->printableCssInclude = $printable_css_include;
$this->linkExtractor = $link_extractor;
$this->configuration += $this->defaultConfiguration();
}
开发者ID:gerbreown1,项目名称:calvaryfree,代码行数:16,代码来源:PrintableFormatBase.php
示例13: __construct
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $pluginId, $pluginDefinition)
{
parent::__construct($configuration, $pluginId, $pluginDefinition);
$this->setConfiguration($configuration);
if (isset($pluginDefinition['parent_zone'])) {
$this->parentZone = $pluginDefinition['parent_zone'];
}
}
开发者ID:jokas,项目名称:d8.dev,代码行数:11,代码来源:ZoneMemberBase.php
示例14: create
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
{
/** @var static $data_type */
$data_type = parent::create($container, $configuration, $plugin_id, $plugin_definition);
/** @var \Drupal\search_api\Backend\BackendPluginManager $backend_manager */
$backend_manager = $container->get('plugin.manager.search_api.backend');
$data_type->setBackendManager($backend_manager);
return $data_type;
}
开发者ID:curveagency,项目名称:intranet,代码行数:12,代码来源:DataTypePluginBase.php
示例15: __construct
/**
* Constructs a new instance.
*
* @param mixed[] $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed[] $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param \Drupal\payment\EventDispatcherInterface $event_dispatcher
* The event dispatcher.
* @param \Drupal\Core\Utility\Token $token
* The token API.
* @param \Drupal\payment\Plugin\Payment\Status\PaymentStatusManagerInterface
* The payment status manager.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, ModuleHandlerInterface $module_handler, EventDispatcherInterface $event_dispatcher, Token $token, PaymentStatusManagerInterface $payment_status_manager)
{
$configuration += $this->defaultConfiguration();
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->eventDispatcher = $event_dispatcher;
$this->moduleHandler = $module_handler;
$this->paymentStatusManager = $payment_status_manager;
$this->token = $token;
}
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:27,代码来源:PaymentMethodBase.php
示例16: __construct
/**
* Overrides the parent constructor to populate context definitions.
*
* Expression plugins can be configured to have arbitrary context definitions.
*
* @param array $configuration
* The plugin configuration, i.e. an array with configuration values keyed
* by configuration option name. The special key 'context_definitions' may
* be used to initialize the context definitions by setting it to an array
* of definitions keyed by context names.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition)
{
if (isset($configuration['context_definitions'])) {
$plugin_definition['context'] = $this->createContextDefinitions($configuration['context_definitions']);
}
if (isset($configuration['provided_definitions'])) {
$plugin_definition['provides'] = $this->createContextDefinitions($configuration['provided_definitions']);
}
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
开发者ID:DrupalTV,项目名称:DrupalTV,代码行数:25,代码来源:ExpressionBase.php
示例17: __construct
/**
* Create a plugin with the given input.
*
* @param string $configuration
* The configuration of the plugin.
* @param string $plugin_id
* The plugin id.
* @param array $plugin_definition
* The plugin definition.
* @param \GuzzleHttp\ClientInterface $http_client
* An HTTP client.
*
* @throws \Exception
*/
public function __construct($configuration, $plugin_id, $plugin_definition, ClientInterface $http_client)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
if (!static::isApplicable($configuration['input'])) {
throw new \Exception('Tried to create a video provider plugin with invalid input.');
}
$this->input = $configuration['input'];
$this->videoId = $this->getIdFromInput($configuration['input']);
$this->httpClient = $http_client;
}
开发者ID:eric-shell,项目名称:eric-shell-d8,代码行数:24,代码来源:ProviderPluginBase.php
示例18: __construct
/**
* BaseUpdateRunner constructor.
*
* @param array $configuration
* @param string $plugin_id
* @param mixed $plugin_definition
* @param \Drupal\Core\Entity\EntityFieldManagerInterface $fieldManager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* @param \Drupal\scheduled_updates\UpdateUtils $updateUtils
* @param \Drupal\Core\Session\AccountSwitcherInterface $accountSwitcher
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityFieldManagerInterface $fieldManager, EntityTypeManagerInterface $entityTypeManager, UpdateUtils $updateUtils, AccountSwitcherInterface $accountSwitcher)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->fieldManager = $fieldManager;
$this->entityTypeManager = $entityTypeManager;
$this->updateUtils = $updateUtils;
$this->accountSwitcher = $accountSwitcher;
if (!empty($configuration['updater_type'])) {
$this->scheduled_update_type = ScheduledUpdateType::load($configuration['updater_type']);
}
}
开发者ID:tedbow,项目名称:scheduled-updates-demo,代码行数:22,代码来源:BaseUpdateRunner.php
示例19: __construct
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration)
{
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
$this->migration = $migration;
$source_plugin = $this->migration->getSourcePlugin();
if (!$source_plugin instanceof SourceEntityInterface) {
throw new MigrateException('Migrations with a load plugin using LoadEntity should have an entity as source.');
}
if ($source_plugin->bundleMigrationRequired() && empty($configuration['bundle_migration'])) {
throw new MigrateException(String::format('Source plugin @plugin requires the bundle_migration key to be set.', array('@plugin' => $source_plugin->getPluginId())));
}
}
开发者ID:anatalsceo,项目名称:en-classe,代码行数:15,代码来源:LoadEntity.php
示例20: __construct
/**
* Constructs an image toolkit operation plugin.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\ImageToolkit\ImageToolkitInterface $toolkit
* The image toolkit.
* @param \Psr\Log\LoggerInterface $logger
* A logger instance.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, ImageToolkitInterface $toolkit, LoggerInterface $logger)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->toolkit = $toolkit;
$this->logger = $logger;
}
开发者ID:nstielau,项目名称:drops-8,代码行数:20,代码来源:ImageToolkitOperationBase.php
注:本文中的Drupal\Core\Plugin\PluginBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论