class ContentEntityFallbackDeriver in Entity Language Fallback 8
Derives a datasource plugin definition for every content entity type.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\search_api\Plugin\search_api\datasource\ContentEntityDeriver implements ContainerDeriverInterface uses StringTranslationTrait
- class \Drupal\entity_language_fallback\Plugin\search_api\datasource\ContentEntityFallbackDeriver
- class \Drupal\search_api\Plugin\search_api\datasource\ContentEntityDeriver implements ContainerDeriverInterface uses StringTranslationTrait
Expanded class hierarchy of ContentEntityFallbackDeriver
File
- src/
Plugin/ search_api/ datasource/ ContentEntityFallbackDeriver.php, line 10
Namespace
Drupal\entity_language_fallback\Plugin\search_api\datasourceView source
class ContentEntityFallbackDeriver extends ContentEntityDeriver {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
if (!isset($this->derivatives)) {
$plugin_derivatives = parent::getDerivativeDefinitions($base_plugin_definition);
foreach ($plugin_derivatives as &$derivative) {
$derivative['label'] .= $this
->t(' (with language fallback)');
}
$this->derivatives = $plugin_derivatives;
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentEntityDeriver:: |
protected | property |
List of derivative definitions. Overrides DeriverBase:: |
|
ContentEntityDeriver:: |
protected | property | The entity type manager. | |
ContentEntityDeriver:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
ContentEntityDeriver:: |
public | function | Retrieves the entity type manager. | |
ContentEntityDeriver:: |
public | function | Sets the entity type manager. | |
ContentEntityFallbackDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides ContentEntityDeriver:: |
|
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |