當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FieldPluginBase::__construct方法代碼示例

本文整理匯總了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');
 }
開發者ID:nB-MDSO,項目名稱:mdso-d8blog,代碼行數:23,代碼來源:DisqusCommentCount.php

示例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;
 }
開發者ID:HakS,項目名稱:drupal8_training,代碼行數:21,代碼來源:BulkForm.php

示例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;
 }
開發者ID:nishantkumar155,項目名稱:drupal8.crackle,代碼行數:27,代碼來源:Amount.php

示例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;
 }
開發者ID:nishantkumar155,項目名稱:drupal8.crackle,代碼行數:27,代碼來源:Currency.php

示例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;
 }
開發者ID:marmouset,項目名稱:drupal,代碼行數:17,代碼來源:EditRemove.php

示例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;
 }
開發者ID:nishantkumar155,項目名稱:drupal8.crackle,代碼行數:16,代碼來源:PaymentStatusLabel.php

示例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;
 }
開發者ID:jokas,項目名稱:d8.dev,代碼行數:17,代碼來源:CountryCode.php

示例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'];
     }
 }
開發者ID:sgtsaughter,項目名稱:d8portfolio,代碼行數:34,代碼來源:Field.php

示例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);
 }
開發者ID:darrylri,項目名稱:protovbmwmo,代碼行數:17,代碼來源:View.php

示例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;
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:20,代碼來源:Date.php

示例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;
 }
開發者ID:HakS,項目名稱:drupal8_training,代碼行數:17,代碼來源:LinkBase.php

示例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;
 }
開發者ID:seongbae,項目名稱:drumo-distribution,代碼行數:17,代碼來源:Subdivision.php

示例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;
 }
開發者ID:alnutile,項目名稱:drunatra,代碼行數:23,代碼來源:Field.php

示例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;
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:17,代碼來源:BulkForm.php

示例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);
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:17,代碼來源:TimeInterval.php


注:本文中的Drupal\views\Plugin\views\field\FieldPluginBase::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。