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


PHP FormatterBase::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Constructs an AddressDefaultFormatter object.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @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.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AddressFormatRepositoryInterface $address_format_repository, CountryRepositoryInterface $country_repository, SubdivisionRepositoryInterface $subdivision_repository)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->addressFormatRepository = $address_format_repository;
     $this->countryRepository = $country_repository;
     $this->subdivisionRepository = $subdivision_repository;
 }
开发者ID:seongbae,项目名称:drumo-distribution,代码行数:31,代码来源:AddressDefaultFormatter.php

示例2: __construct

 /**
  * Constructs an AddToCartFormatter object.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Any third party settings.
  * @param \Drupal\Core\Entity\EntityFormBuilderInterface $entity_form_builder
  *   The entity form builder.
  * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
  *   The entity type manager.
  * @param \Drupal\commerce_product\LineItemTypeMapInterface $line_item_type_map
  *   The line item type map.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityFormBuilderInterface $entity_form_builder, EntityTypeManagerInterface $entity_type_manager, LineItemTypeMapInterface $line_item_type_map)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->entityFormBuilder = $entity_form_builder;
     $this->entityTypeManager = $entity_type_manager;
     $this->lineItemTypeMap = $line_item_type_map;
 }
开发者ID:alexburrows,项目名称:cream-2.x,代码行数:31,代码来源:AddToCartFormatter.php

示例3: __construct

 /**
  * Constructs a new instance.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Any third party settings.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, RequestStack $request_stack, EntityFormBuilderInterface $entity_form_builder, EntityStorageInterface $payment_storage, PaymentLineItemManagerInterface $payment_line_item_manager)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->entityFormBuilder = $entity_form_builder;
     $this->paymentLineItemManager = $payment_line_item_manager;
     $this->paymentStorage = $payment_storage;
     $this->requestStack = $request_stack;
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:26,代码来源:PaymentForm.php

示例4: __construct

  /**
   * Constructs a new PriceDefaultFormatter object.
   *
   * @param string $pluginId
   *   The plugin_id for the formatter.
   * @param mixed $pluginDefinition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition
   *   The definition of the field to which the formatter is associated.
   * @param array $settings
   *   The formatter settings.
   * @param string $label
   *   The formatter label display setting.
   * @param string $viewMode
   *   The view mode.
   * @param array $thirdPartySettings
   *   Any third party settings 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, $label, $viewMode, array $thirdPartySettings, EntityTypeManagerInterface $entityTypeManager, NumberFormatterFactoryInterface $numberFormatterFactory) {
    parent::__construct($pluginId, $pluginDefinition, $fieldDefinition, $settings, $label, $viewMode, $thirdPartySettings);

    $this->currencyStorage = $entityTypeManager->getStorage('commerce_currency');
    $this->numberFormatter = $numberFormatterFactory->createInstance();
    $this->numberFormatter->setMaximumFractionDigits(6);
    if ($this->getSetting('strip_trailing_zeroes')) {
      $this->numberFormatter->setMinimumFractionDigits(0);
    }
    if ($this->getSetting('display_currency_code')) {
      $this->numberFormatter->setCurrencyDisplay(NumberFormatterInterface::CURRENCY_DISPLAY_CODE);
    }
  }
开发者ID:housineali,项目名称:drpl8_dv,代码行数:35,代码来源:PriceDefaultFormatter.php

示例5: __construct

 /**
  * Constructs a TimestampAgoFormatter object.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Any third party settings.
  * @param \Drupal\Core\Datetime\DateFormatter $date_formatter
  *   The date formatter service.
  * @param \Symfony\Component\HttpFoundation\Request $request
  *   The current request.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, DateFormatter $date_formatter, Request $request)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->dateFormatter = $date_formatter;
     $this->request = $request;
 }
开发者ID:komejo,项目名称:article-test,代码行数:28,代码来源:TimestampAgoFormatter.php

示例6: __construct

 /**
  * Constructs a new CommentDefaultFormatter.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Third party settings.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The current user.
  * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
  *   The entity manager
  * @param \Drupal\Core\Entity\EntityFormBuilderInterface $entity_form_builder
  *   The entity form builder.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, EntityManagerInterface $entity_manager, EntityFormBuilderInterface $entity_form_builder)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->viewBuilder = $entity_manager->getViewBuilder('comment');
     $this->storage = $entity_manager->getStorage('comment');
     $this->currentUser = $current_user;
     $this->entityManager = $entity_manager;
     $this->entityFormBuilder = $entity_form_builder;
 }
开发者ID:HakS,项目名称:drupal8_training,代码行数:33,代码来源:CommentDefaultFormatter.php

示例7: __construct

 /**
  * Constructs a StringFormatter instance.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Any third party settings settings.
  * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
  *   The entity manager.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityManagerInterface $entity_manager)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->entityManager = $entity_manager;
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:25,代码来源:StringFormatter.php

示例8: __construct

 /**
  * Constructs a new instance of the plugin.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Third party settings.
  * @param \Drupal\video\ProviderManagerInterface $provider_manager
  *   The video embed provider manager.
  */
 public function __construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, ProviderManagerInterface $provider_manager)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->providerManager = $provider_manager;
 }
开发者ID:iAssureIT,项目名称:iimisac,代码行数:25,代码来源:VideoEmbedPlayerFormatter.php

示例9: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($plugin_id, $plugin_definition, \Drupal\Core\Field\FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
 }
开发者ID:pedrocones,项目名称:geolocation,代码行数:7,代码来源:GeolocationGoogleMapFormatter.php

示例10: __construct

 /**
  * Constructs a new PricePlainFormatter object.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Any third party settings 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, $label, $view_mode, array $third_party_settings, EntityTypeManagerInterface $entity_type_manager)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->currencyStorage = $entity_type_manager->getStorage('commerce_currency');
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:25,代码来源:PricePlainFormatter.php

示例11: __construct

 /**
  * Constructs a new DisqusFormatter.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The current user.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, AccountInterface $current_user)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, array());
     $this->currentUser = $current_user;
 }
开发者ID:nB-MDSO,项目名称:mdso-d8blog,代码行数:23,代码来源:DisqusFormatter.php

示例12: __construct

 /**
  * Constructs a new instance of the plugin.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Third party settings.
  * @param \Drupal\video_embed_field\ProviderManagerInterface $provider_manager
  *   The video embed provider manager.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, $settings, $label, $view_mode, $third_party_settings, ProviderManagerInterface $provider_manager, EntityStorageInterface $image_style_storage)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->providerManager = $provider_manager;
     $this->imageStyleStorage = $image_style_storage;
 }
开发者ID:eric-shell,项目名称:eric-shell-d8,代码行数:26,代码来源:Thumbnail.php

示例13: __construct

 /**
  * Video constructor.
  *
  * @param string $plugin_id
  *   The plugin ID.
  * @param mixed $plugin_definition
  *   The plugin definitin.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The field definition.
  * @param array $settings
  *   Formatter settings.
  * @param string $label
  *   Field label.
  * @param string $view_mode
  *   The view mode ID.
  * @param array $third_party_settings
  *   Additional third-party settings.
  * @param \Drupal\media_entity_embeddable_video\VideoProviderManager $video_provider_manager
  *   The video provider manager.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, VideoProviderManager $video_provider_manager)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->videoProviderManager = $video_provider_manager;
 }
开发者ID:DrupalTV,项目名称:DrupalTV,代码行数:25,代码来源:Video.php

示例14: __construct

 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->formatterManager = \Drupal::service('plugin.manager.field.formatter');
 }
开发者ID:DrupalTV,项目名称:DrupalTV,代码行数:5,代码来源:FallbackFormatter.php

示例15: __construct

 /**
  * Constructs an AddToCartFormatter object.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Any third party settings.
  * @param \Drupal\Core\Form\FormBuilderInterface $form_builder
  *   The form builder.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, FormBuilderInterface $form_builder)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->formBuilder = $form_builder;
 }
开发者ID:marmouset,项目名称:drupal,代码行数:25,代码来源:AddToCartFormatter.php


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