當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。