当前位置: 首页>>代码示例>>PHP>>正文


PHP WidgetBase::__construct方法代码示例

本文整理汇总了PHP中Drupal\Core\Field\WidgetBase::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP WidgetBase::__construct方法的具体用法?PHP WidgetBase::__construct怎么用?PHP WidgetBase::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Core\Field\WidgetBase的用法示例。


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

示例1: __construct

 /**
  * Constructs a new instance.
  *
  * @param string $plugin_id
  *   The plugin_id for the widget.
  * @param mixed[] $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the widget is associated.
  * @param mied[] $settings
  *   The widget settings.
  * @param array[] $third_party_settings
  *   Any third party settings.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The current user.
  * @param \Drupal\payment_reference\PaymentFactoryInterface $payment_factory
  *   The payment reference factory.
  */
 public function __construct($plugin_id, array $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, ConfigFactoryInterface $config_factory, AccountInterface $current_user, PaymentFactoryInterface $payment_factory)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->configFactory = $config_factory;
     $this->currentUser = $current_user;
     $this->paymentFactory = $payment_factory;
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:27,代码来源:PaymentReference.php

示例2: __construct

  /**
   * Constructs an InlineEntityFormBase object.
   *
   * @param array $plugin_id
   *   The plugin_id for the widget.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The definition of the field to which the widget is associated.
   * @param array $settings
   *   The widget settings.
   * @param array $third_party_settings
   *   Any third party settings.
   * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
   *   The entity type bundle info.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   */
  public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager) {
    parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);

    $this->entityTypeBundleInfo = $entity_type_bundle_info;
    $this->entityTypeManager = $entity_type_manager;
    $this->initializeIefController();
  }
开发者ID:joebachana,项目名称:usatne,代码行数:25,代码来源:InlineEntityFormBase.php

示例3: __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.
  * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
  *   Entity manager service.
  * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
  *   Event dispatcher.
  * @param \Drupal\entity_browser\FieldWidgetDisplayManager $field_display_manager
  *   Field widget display plugin manager.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityManagerInterface $entity_manager, EventDispatcherInterface $event_dispatcher, FieldWidgetDisplayManager $field_display_manager)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->entityManager = $entity_manager;
     $this->fieldDisplayManager = $field_display_manager;
     $event_dispatcher->addListener(Events::REGISTER_JS_CALLBACKS, [$this, 'registerJSCallback']);
 }
开发者ID:DrupalTV,项目名称:DrupalTV,代码行数:25,代码来源:EntityReference.php

示例4: __construct

 /**
  * Constructs an InlineEntityFormBase object.
  *
  * @param array $plugin_id
  *   The plugin_id for the widget.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the widget is associated.
  * @param array $settings
  *   The widget settings.
  * @param array $third_party_settings
  *   Any third party settings.
  * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
  *   The entity type bundle info.
  * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
  *   The entity type manager.
  * @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface
  *   The entity display repository.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->entityTypeBundleInfo = $entity_type_bundle_info;
     $this->entityTypeManager = $entity_type_manager;
     $this->entityDisplayRepository = $entity_display_repository;
     $this->createInlineFormHandler();
 }
开发者ID:CIGIHub,项目名称:bsia-drupal8,代码行数:28,代码来源:InlineEntityFormBase.php

示例5: __construct

  /**
   * Constructs a new PriceDefaultWidget object.
   *
   * @param string $pluginId
   *   The plugin_id for the widget.
   * @param mixed $pluginDefinition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition
   *   The definition of the field to which the widget is associated.
   * @param array $settings
   *   The widget settings.
   * @param array $thirdPartySettings
   *   Any third party settings.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
   *   The entity type manager.
   * @param \Drupal\commerce_price\NumberFormatterFactoryInterface $numberFormatterFactory
   *   The number formatter factory.
   */
  public function __construct($pluginId, $pluginDefinition, FieldDefinitionInterface $fieldDefinition, array $settings, array $thirdPartySettings, EntityTypeManagerInterface $entityTypeManager, NumberFormatterFactoryInterface $numberFormatterFactory) {
    parent::__construct($pluginId, $pluginDefinition, $fieldDefinition, $settings, $thirdPartySettings);

    $this->currencyStorage = $entityTypeManager->getStorage('commerce_currency');
    $this->numberFormatter = $numberFormatterFactory->createInstance(NumberFormatterInterface::DECIMAL);
    $this->numberFormatter->setMinimumFractionDigits(0);
    $this->numberFormatter->setMaximumFractionDigits(6);
    $this->numberFormatter->setGroupingUsed(FALSE);
  }
开发者ID:housineali,项目名称:drpl8_dv,代码行数:27,代码来源:PriceDefaultWidget.php

示例6: __construct

 /**
  * Constructs widget plugin.
  *
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the widget is associated.
  * @param array $settings
  *   The widget settings.
  * @param array $third_party_settings
  *   Any third party settings.
  * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
  *   Entity manager service.
  * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
  *   Event dispatcher.
  * @param \Drupal\entity_browser\FieldWidgetDisplayManager $field_display_manager
  *   Field widget display plugin manager.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityManagerInterface $entity_manager, EventDispatcherInterface $event_dispatcher, FieldWidgetDisplayManager $field_display_manager)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->entityManager = $entity_manager;
     $this->fieldDisplayManager = $field_display_manager;
 }
开发者ID:nB-MDSO,项目名称:mdso-d8blog,代码行数:26,代码来源:EntityReference.php

示例7: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, ConfigFactoryInterface $config_factory)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->configFactory = $config_factory;
 }
开发者ID:Cyberschorsch,项目名称:module-ivw_integration,代码行数:8,代码来源:BddIvwSettingsWidget.php

示例8: __construct

 /**
  * Constructs a AddressDefaultWidget object.
  *
  * @param string $plugin_id
  *   The plugin_id for the widget.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the widget is associated.
  * @param array $settings
  *   The widget settings.
  * @param array $third_party_settings
  *   Any third party settings.
  * @param \CommerceGuys\Addressing\Repository\AddressFormatRepositoryInterface $address_format_repository
  *   The address format repository.
  * @param \CommerceGuys\Addressing\Repository\CountryRepositoryInterface $country_repository
  *   The country repository.
  * @param \CommerceGuys\Addressing\Repository\SubdivisionRepositoryInterface $subdivision_repository
  *   The subdivision repository.
  * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
  *   The event dispatcher.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, AddressFormatRepositoryInterface $address_format_repository, CountryRepositoryInterface $country_repository, SubdivisionRepositoryInterface $subdivision_repository, EventDispatcherInterface $event_dispatcher, ConfigFactoryInterface $config_factory)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->addressFormatRepository = $address_format_repository;
     $this->countryRepository = $country_repository;
     $this->subdivisionRepository = $subdivision_repository;
     $this->eventDispatcher = $event_dispatcher;
     $this->configFactory = $config_factory;
 }
开发者ID:r-daneelolivaw,项目名称:chalk,代码行数:33,代码来源:AddressDefaultWidget.php

示例9: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, MetatagManager $manager)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->metatagManager = $manager;
 }
开发者ID:eric-shell,项目名称:eric-shell-d8,代码行数:8,代码来源:MetatagFirehose.php

示例10: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityStorageInterface $term_storage, VocabularyStorageInterface $vocabulary_storage)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->termStorage = $term_storage;
     $this->vocabularyStorage = $vocabulary_storage;
 }
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:9,代码来源:TaxonomyAutocompleteWidget.php

示例11: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->metatagManager = \Drupal::service('metatag.manager');
 }
开发者ID:krknth,项目名称:d8p,代码行数:8,代码来源:MetatagFirehose.php

示例12: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityStorageInterface $date_storage)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->dateStorage = $date_storage;
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:8,代码来源:DateTimeDefaultWidget.php

示例13: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, AccountInterface $current_user)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, array());
     $this->currentUser = $current_user;
 }
开发者ID:hugronaphor,项目名称:cornel,代码行数:8,代码来源:DisqusWidget.php

示例14: __construct

 /**
  * Constructs a new ProductVariationAttributesWidget object.
  *
  * @param string $plugin_id
  *   The plugin_id for the widget.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the widget is associated.
  * @param array $settings
  *   The widget settings.
  * @param array $third_party_settings
  *   Any third party settings.
  * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
  *   The entity type manager.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityTypeManagerInterface $entity_type_manager)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $this->variationStorage = $entity_type_manager->getStorage('commerce_product_variation');
 }
开发者ID:alexburrows,项目名称:cream-2.x,代码行数:21,代码来源:ProductVariationAttributesWidget.php

示例15: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
     $property_names = $this->fieldDefinition->getFieldStorageDefinition()->getPropertyNames();
     $this->column = $property_names[0];
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:9,代码来源:OptionsWidgetBase.php


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