Drupal 8  8.0.2
LanguageFormatter Class Reference
Inheritance diagram for LanguageFormatter:

Public Member Functions

 __construct ($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager)
 
 settingsForm (array $form, FormStateInterface $form_state)
 
 settingsSummary ()
 
- Public Member Functions inherited from StringFormatter
 __construct ($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityManagerInterface $entity_manager)
 
 settingsForm (array $form, FormStateInterface $form_state)
 
 settingsSummary ()
 
 viewElements (FieldItemListInterface $items, $langcode)
 
- Public Member Functions inherited from FormatterBase
 __construct ($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings)
 
 view (FieldItemListInterface $items, $langcode=NULL)
 
 settingsForm (array $form, FormStateInterface $form_state)
 
 settingsSummary ()
 
 prepareView (array $entities_items)
 
- Public Member Functions inherited from PluginSettingsBase
 getSettings ()
 
 getSetting ($key)
 
 setSettings (array $settings)
 
 setSetting ($key, $value)
 
 getThirdPartySettings ($module=NULL)
 
 getThirdPartySetting ($module, $key, $default=NULL)
 
 setThirdPartySetting ($module, $key, $value)
 
 unsetThirdPartySetting ($module, $key)
 
 getThirdPartyProviders ()
 
 calculateDependencies ()
 
 onDependencyRemoval (array $dependencies)
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 
static defaultSettings ()
 
- Static Public Member Functions inherited from StringFormatter
static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 
static defaultSettings ()
 
- Static Public Member Functions inherited from FormatterBase
static isApplicable (FieldDefinitionInterface $field_definition)
 
- Static Public Member Functions inherited from PluginSettingsBase
static defaultSettings ()
 

Protected Member Functions

 viewValue (FieldItemInterface $item)
 
- Protected Member Functions inherited from StringFormatter
 viewValue (FieldItemInterface $item)
 
- Protected Member Functions inherited from FormatterBase
 getFieldSettings ()
 
 getFieldSetting ($setting_name)
 
- Protected Member Functions inherited from PluginSettingsBase
 mergeDefaults ()
 

Protected Attributes

 $languageManager
 
- Protected Attributes inherited from FormatterBase
 $fieldDefinition
 
 $settings
 
 $label
 
 $viewMode
 
- Protected Attributes inherited from PluginSettingsBase
 $settings = array()
 
 $thirdPartySettings = array()
 
 $defaultSettingsMerged = FALSE
 

Detailed Description

Plugin implementation of the 'language' formatter.

( id = "language", label = ("Language"), field_types = { "language" } )

Constructor & Destructor Documentation

__construct (   $plugin_id,
  $plugin_definition,
FieldDefinitionInterface  $field_definition,
array  $settings,
  $label,
  $view_mode,
array  $third_party_settings,
EntityManagerInterface  $entity_manager,
LanguageManagerInterface  $language_manager 
)

Constructs a LanguageFormatter instance.

Parameters
string$plugin_idThe plugin_id for the formatter.
mixed$plugin_definitionThe plugin implementation definition.
\Drupal\Core\Field\FieldDefinitionInterface$field_definitionThe definition of the field to which the formatter is associated.
array$settingsThe formatter settings.
string$labelThe formatter label display setting.
string$view_modeThe view mode.
array$third_party_settingsAny third party settings settings.
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager.

References Drupal\languageManager().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

static defaultSettings ( )
static

{Defines the default settings for this plugin.

Returns
array A list of default settings, keyed by the setting name.
}

Implements PluginSettingsInterface.

settingsForm ( array  $form,
FormStateInterface  $form_state 
)

{Returns a form to configure settings for the formatter.Invoked from to allow administrators to configure the formatter. The field_ui module takes care of handling submitted form values.

Parameters
array$formThe form where the settings form is being included in.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
Returns
array The form elements for the formatter settings.
}

Implements FormatterInterface.

References PluginSettingsBase\getSetting(), and t().

Here is the call graph for this function:

settingsSummary ( )

{Returns a short summary for the current formatter settings.If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.

Returns
string[] A short summary of the formatter settings.
}

Implements FormatterInterface.

References PluginSettingsBase\getSetting(), and t().

Here is the call graph for this function:

viewValue ( FieldItemInterface  $item)
protected

{}

References TypedDataInterface\getName(), PluginSettingsBase\getSetting(), Drupal\languageManager(), and LanguageInterface\STATE_ALL.

Here is the call graph for this function:


The documentation for this class was generated from the following file: