예제 #1
0
 /**
  * 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;
 }
예제 #2
0
 /**
  * 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;
 }
 /**
  * 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;
 }
예제 #4
0
 /**
  * Default constructor
  */
 public function __construct(array $configuration, $pluginId, $pluginDefinition)
 {
     parent::__construct($configuration, $pluginId, $pluginDefinition);
     if (isset($configuration['settings'])) {
         $this->settings = (array) $configuration['settings'];
     }
 }
예제 #5
0
 /**
  * {@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();
 }
예제 #6
0
 /**
  * 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);
 }
 /**
  * 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;
 }
 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);
     }
 }
 /**
  * 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;
 }
예제 #10
0
 /**
  * {@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);
 }
예제 #11
0
 /**
  * {@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();
 }
예제 #12
0
 /**
  * {@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'];
     }
 }
 /**
  * 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;
 }
 /**
  * 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;
 }
예제 #15
0
 /**
  * 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);
 }
예제 #16
0
 /**
  * Constructs a ImageEffectsPluginBase 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\Config\ConfigFactoryInterface $config_factory
  *   The configuration factory.
  * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator
  *   The URL generator.
  * @param \Psr\Log\LoggerInterface $logger
  *   The image_effects logger.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory, UrlGeneratorInterface $url_generator, LoggerInterface $logger)
 {
     $this->config = $config_factory->getEditable('image_effects.settings');
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->pluginType = $configuration['plugin_type'];
     $config = $this->config->get($this->pluginType . '.plugin_settings.' . $plugin_id);
     $this->setConfiguration(array_merge($this->defaultConfiguration(), is_array($config) ? $config : array()));
     $this->urlGenerator = $url_generator;
     $this->logger = $logger;
 }
 /**
  * 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']);
     }
 }
예제 #18
0
 /**
  * {@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())));
     }
 }
예제 #19
0
 /**
  * Constructs a Drupal\rest\Plugin\ResourceBase 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 array $serializer_formats
  *   The available serialization formats.
  * @param \Psr\Log\LoggerInterface $logger
  *   A logger instance.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, array $serializer_formats, LoggerInterface $logger)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->serializerFormats = $serializer_formats;
     $this->logger = $logger;
 }
예제 #20
0
 /**
  * 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;
 }
예제 #21
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->migration = $migration;
     // Set up some defaults based on the source configuration.
     $this->cacheCounts = !empty($configuration['cache_counts']);
     $this->skipCount = !empty($configuration['skip_count']);
     $this->cacheKey = !empty($configuration['cache_key']) ? !empty($configuration['cache_key']) : NULL;
     $this->trackChanges = !empty($configuration['track_changes']) ? $configuration['track_changes'] : FALSE;
     // Pull out the current highwater mark if we have a highwater property.
     if ($this->highWaterProperty = $this->migration->get('highWaterProperty')) {
         $this->originalHighWater = $this->migration->getHighWater();
     }
     // Don't allow the use of both highwater and track changes together.
     if ($this->highWaterProperty && $this->trackChanges) {
         throw new MigrateException('You should either use a highwater mark or track changes not both. They are both designed to solve the same problem');
     }
 }
예제 #22
0
파일: Migration.php 프로젝트: 318io/318-io
 /**
  * Constructs a Migration.
  *
  * @param array $configuration
  *   Plugin configuration.
  * @param string $plugin_id
  *   The plugin ID.
  * @param mixed $plugin_definition
  *   The plugin definition.
  * @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager
  *   The migration plugin manager.
  * @param \Drupal\migrate\Plugin\MigratePluginManager $source_plugin_manager
  *   The source migration plugin manager.
  * @param \Drupal\migrate\Plugin\MigratePluginManager $process_plugin_manager
  *   The process migration plugin manager.
  * @param \Drupal\migrate\Plugin\MigrateDestinationPluginManager $destination_plugin_manager
  *   The destination migration plugin manager.
  * @param \Drupal\migrate\Plugin\MigratePluginManager $idmap_plugin_manager
  *   The ID map migration plugin manager.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationPluginManagerInterface $migration_plugin_manager, MigratePluginManager $source_plugin_manager, MigratePluginManager $process_plugin_manager, MigrateDestinationPluginManager $destination_plugin_manager, MigratePluginManager $idmap_plugin_manager)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->migrationPluginManager = $migration_plugin_manager;
     $this->sourcePluginManager = $source_plugin_manager;
     $this->processPluginManager = $process_plugin_manager;
     $this->destinationPluginManager = $destination_plugin_manager;
     $this->idMapPluginManager = $idmap_plugin_manager;
     foreach ($plugin_definition as $key => $value) {
         $this->{$key} = $value;
     }
 }
예제 #23
0
 public function __construct(array $configuration, $plugin_id, $plugin_definition)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $iconsetFinderService = \Drupal::service('social_media_links.finder');
     $this->path = $iconsetFinderService->getPath($plugin_id);
 }
 /**
  * Constructs a new 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\plugin\DefaultPluginResolver\DefaultPluginResolverInterface $default_plugin_resolver
  *   The default plugin resolver.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, DefaultPluginResolverInterface $default_plugin_resolver)
 {
     $configuration += $this->defaultConfiguration();
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->defaultPluginResolver = $default_plugin_resolver;
 }
 /**
  * {@inheritdoc}
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerInterface $logger)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->setConfiguration($configuration);
     $this->logger = $logger;
 }
 /**
  * Constructs a new 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 \Commercie\CurrencyExchange\ExchangeRateProviderInterface
  *   The decorated exchange rate provider.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, GenericExchangeRateProviderInterface $exchange_rate_provider)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->exchangeRateProvider = $exchange_rate_provider;
 }
예제 #27
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->migration = $migration;
 }
예제 #28
0
 /**
  * Constructs a static version detector.
  *
  * @param array $configuration
  * @param string $plugin_id
  * @param array $plugin_definition
  */
 public function __construct(array $configuration, $plugin_id, array $plugin_definition)
 {
     $configuration += ['version' => NULL];
     parent::__construct($configuration, $plugin_id, $plugin_definition);
 }
예제 #29
0
 /**
  * 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;
 }
예제 #30
0
 /**
  * Constructs an SQL object.
  *
  * Sets up the tables and builds the maps,
  *
  * @param array $configuration
  *   The configuration.
  * @param string $plugin_id
  *   The plugin ID for the migration process to do.
  * @param mixed $plugin_definition
  *   The configuration for the plugin.
  * @param \Drupal\migrate\Entity\MigrationInterface $migration
  *   The migration to do.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EventDispatcherInterface $event_dispatcher)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->migration = $migration;
     $this->eventDispatcher = $event_dispatcher;
 }