Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LanguageNegotiation.php

class LanguageNegotiation

Same name in this branch
  1. 11.1.x core/modules/language/src/Annotation/LanguageNegotiation.php \Drupal\language\Annotation\LanguageNegotiation
  2. 11.1.x core/modules/language/src/Plugin/migrate/process/LanguageNegotiation.php \Drupal\language\Plugin\migrate\process\LanguageNegotiation

Defines a language negotiation attribute object.

Plugin Namespace: Plugin\LanguageNegotiation

For a working example, see \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationBrowser.

Hierarchy

  • class \Drupal\Component\Plugin\Attribute\AttributeBase implements \Drupal\Component\Plugin\Attribute\AttributeInterface
    • class \Drupal\Component\Plugin\Attribute\Plugin extends \Drupal\Component\Plugin\Attribute\AttributeBase
      • class \Drupal\language\Attribute\LanguageNegotiation extends \Drupal\Component\Plugin\Attribute\Plugin

Expanded class hierarchy of LanguageNegotiation

See also

\Drupal\language\LanguageNegotiator

\Drupal\language\LanguageNegotiationMethodManager

\Drupal\language\LanguageNegotiationMethodInterface

hook_language_negotiation_info_alter()

Plugin API

10 files declare their use of LanguageNegotiation
LanguageNegotiationBrowser.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationBrowser.php
LanguageNegotiationContentEntity.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php
LanguageNegotiationMethodManager.php in core/modules/language/src/LanguageNegotiationMethodManager.php
LanguageNegotiationSelected.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php
LanguageNegotiationSession.php in core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSession.php

... See full list

File

core/modules/language/src/Attribute/LanguageNegotiation.php, line 22

Namespace

Drupal\language\Attribute
View source
class LanguageNegotiation extends Plugin {
    
    /**
     * Constructs an LanguageNegotiation attribute.
     *
     * @param string $id
     *   The language negotiation plugin ID.
     * @param \Drupal\Core\StringTranslation\TranslatableMarkup $name
     *   The human-readable name of the language negotiation plugin.
     * @param string[]|null $types
     *   An array of language types, such as the
     *    \Drupal\Core\Language\LanguageInterface::TYPE_* constants.
     *   If a language negotiation plugin does not specify which language types it
     *   should be used with, it will be available for all the configurable
     *   language types.
     * @param int $weight
     *   The default weight of the language negotiation plugin.
     * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
     *   The description of the language negotiation plugin.
     * @param string|null $config_route_name
     *   (optional) The route pointing to the plugin's configuration page.
     */
    public function __construct(string $id, TranslatableMarkup $name, ?array $types = NULL, int $weight = 0, ?TranslatableMarkup $description = NULL, ?string $config_route_name = NULL) {
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AttributeBase::$class protected property The class used for this attribute class.
AttributeBase::$provider protected property The provider of the attribute class.
AttributeBase::get public function Gets the value of an attribute. Overrides AttributeInterface::get 6
AttributeBase::getClass public function Gets the class of the attribute class. Overrides AttributeInterface::getClass 1
AttributeBase::getId public function Gets the unique ID for this attribute class. Overrides AttributeInterface::getId
AttributeBase::getProvider public function Gets the name of the provider of the attribute class. Overrides AttributeInterface::getProvider
AttributeBase::setClass public function Sets the class of the attributed class. Overrides AttributeInterface::setClass 1
AttributeBase::setProvider public function Sets the name of the provider of the attribute class. Overrides AttributeInterface::setProvider
LanguageNegotiation::__construct public function Constructs an LanguageNegotiation attribute. Overrides Plugin::__construct

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal