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