本文整理汇总了PHP中Drupal\views\Plugin\views\field\FieldPluginBase::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldPluginBase::__construct方法的具体用法?PHP FieldPluginBase::__construct怎么用?PHP FieldPluginBase::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\views\Plugin\views\field\FieldPluginBase
的用法示例。
在下文中一共展示了FieldPluginBase::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructs a 'Disqus Comment Count' view field 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 \Drupal\Core\Session\AccountInterface $current_user
* The current user.
* @param \Drupal\disqus\DisqusCommentManager $disqus_manager
* The disqus comment manager object.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountInterface $current_user, DisqusCommentManager $disqus_manager, ConfigFactoryInterface $config_factory)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->currentUser = $current_user;
$this->disqusManager = $disqus_manager;
$this->config = $config_factory->get('disqus.settings');
}
示例2: __construct
/**
* Constructs a new BulkForm 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.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityManager = $entity_manager;
$this->actionStorage = $entity_manager->getStorage('action');
$this->languageManager = $language_manager;
}
示例3: __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\StringTranslation\TranslationInterface $string_translation
* The string translator.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param \Drupal\Core\Render\RendererInterface
* The renderer.
* @param \Drupal\Core\Entity\EntityStorageInterface $currency_storage
* THe currency storage.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, TranslationInterface $string_translation, ModuleHandlerInterface $module_handler, RendererInterface $renderer, EntityStorageInterface $currency_storage)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->definition += $this->defaultDefinition();
$this->currencyStorage = $currency_storage;
$this->moduleHandler = $module_handler;
$this->renderer = $renderer;
$this->stringTranslation = $string_translation;
}
示例4: __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\StringTranslation\TranslationInterface $string_translation
* The string translator.
* @param \Drupal\Core\Entity\EntityStorageInterface $currency_storage
* THe currency storage.
*
* @throws \InvalidArgumentException
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, TranslationInterface $string_translation, EntityStorageInterface $currency_storage)
{
if (!isset($configuration['currency_method'])) {
throw new \InvalidArgumentException('Missing currency_method definition.');
} elseif (!method_exists(CurrencyInterface::class, $configuration['currency_method'])) {
throw new \InvalidArgumentException(sprintf('Method %s does not exist on \\Drupal\\currency\\Entity\\CurrencyInterface.', $configuration['currency_method']));
}
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->currencyStorage = $currency_storage;
$this->stringTranslation = $string_translation;
}
示例5: __construct
/**
* Constructs a new EditRemove 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\commerce_cart\CartManagerInterface $cart_manager
* The cart manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, CartManagerInterface $cart_manager)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->cartManager = $cart_manager;
}
示例6: __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\payment\Plugin\Payment\Status\PaymentStatusManagerInterface $payment_status_manager
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, PaymentStatusManagerInterface $payment_status_manager)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->paymentStatusManager = $payment_status_manager;
}
示例7: __construct
/**
* Constructs a CountryCode object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $pluginId
* The id of the plugin instance.
* @param mixed $pluginDefinition
* The plugin implementation definition.
* @param \CommerceGuys\Addressing\Repository\CountryRepositoryInterface $countryRepository
* The country repository.
*/
public function __construct(array $configuration, $pluginId, $pluginDefinition, CountryRepositoryInterface $countryRepository)
{
parent::__construct($configuration, $pluginId, $pluginDefinition);
$this->countryRepository = $countryRepository;
}
示例8: __construct
/**
* Constructs a \Drupal\field\Plugin\views\field\Field 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 field formatter plugin manager.
* @param \Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager
* The field formatter plugin manager.
* @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_plugin_manager
* The field plugin type manager.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, FormatterPluginManager $formatter_plugin_manager, FieldTypePluginManagerInterface $field_type_plugin_manager, LanguageManagerInterface $language_manager, RendererInterface $renderer)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityManager = $entity_manager;
$this->formatterPluginManager = $formatter_plugin_manager;
$this->fieldTypePluginManager = $field_type_plugin_manager;
$this->languageManager = $language_manager;
$this->renderer = $renderer;
// @todo Unify 'entity field'/'field_name' instead of converting back and
// forth. https://www.drupal.org/node/2410779
if (isset($this->definition['entity field'])) {
$this->definition['field_name'] = $this->definition['entity field'];
}
}
示例9: __construct
/**
* Constructs a View 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\ImmutableConfig $config
* The configuration object.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, ImmutableConfig $config)
{
$this->config = $config;
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
示例10: __construct
/**
* Constructs a new Date 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\Datetime\DateFormatter $date_formatter
* The date formatter service.
* @param \Drupal\Core\Entity\EntityStorageInterface $date_format_storage
* The date format storage.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatter $date_formatter, EntityStorageInterface $date_format_storage)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->dateFormatter = $date_formatter;
$this->dateFormatStorage = $date_format_storage;
}
示例11: __construct
/**
* Constructs a LinkBase 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\Access\AccessManagerInterface $access_manager
* The access manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, AccessManagerInterface $access_manager)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->accessManager = $access_manager;
}
示例12: __construct
/**
* Constructs a Subdivision object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The id of the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \CommerceGuys\Addressing\Repository\SubdivisionRepositoryInterface $subdivision_repository
* The subdivision repository.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, SubdivisionRepositoryInterface $subdivision_repository)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->subdivisionRepository = $subdivision_repository;
}
示例13: __construct
/**
* Constructs a \Drupal\field\Plugin\views\field\Field 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 field formatter plugin manager.
* @param \Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager
* The field formatter plugin manager.
* @param \Drupal\Core\Language\LanguageManager $language_manager
* The language manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, FormatterPluginManager $formatter_plugin_manager, LanguageManager $language_manager)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityManager = $entity_manager;
$this->formatterPluginManager = $formatter_plugin_manager;
$this->languageManager = $language_manager;
}
示例14: __construct
/**
* Constructs a new BulkForm 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\EntityStorageInterface $storage
* The action storage.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $storage)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->actionStorage = $storage;
}
示例15: __construct
/**
* Constructs a TimeInterval plugin 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\Datetime\DateFormatter $date_formatter
* The date formatter service.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatter $date_formatter)
{
$this->dateFormatter = $date_formatter;
parent::__construct($configuration, $plugin_id, $plugin_definition);
}