class FieldTypeToSynonyms in Synonyms 8
Same name and namespace in other branches
- 2.0.x src/SynonymsService/FieldTypeToSynonyms.php \Drupal\synonyms\SynonymsService\FieldTypeToSynonyms
Service to map known field types to how synonyms are encoded in them.
Hierarchy
- class \Drupal\synonyms\SynonymsService\FieldTypeToSynonyms
Expanded class hierarchy of FieldTypeToSynonyms
3 files declare their use of FieldTypeToSynonyms
- BaseField.php in src/
Plugin/ Synonyms/ Provider/ BaseField.php - Field.php in src/
Plugin/ Derivative/ Field.php - Field.php in src/
Plugin/ Synonyms/ Provider/ Field.php
1 string reference to 'FieldTypeToSynonyms'
1 service uses FieldTypeToSynonyms
File
- src/
SynonymsService/ FieldTypeToSynonyms.php, line 10
Namespace
Drupal\synonyms\SynonymsServiceView source
class FieldTypeToSynonyms {
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* FieldTypeToSynonyms constructor.
*/
public function __construct(ModuleHandlerInterface $module_handler) {
$this->moduleHandler = $module_handler;
}
/**
* Map field types to the properties within them where synonyms are stored.
*
* @return array
* Map where keys are simple field types and values are the properties where
* the corresponding field type keeps the synonyms
*/
public function getSimpleFieldTypeToPropertyMap() {
$map = [
'integer' => 'value',
'float' => 'value',
'decimal' => 'value',
'string' => 'value',
'email' => 'value',
'telephone' => 'value',
];
$this->moduleHandler
->alter('synonyms_field_type_to_synonym', $map);
return $map;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FieldTypeToSynonyms:: |
protected | property | The module handler. | |
FieldTypeToSynonyms:: |
public | function | Map field types to the properties within them where synonyms are stored. | |
FieldTypeToSynonyms:: |
public | function | FieldTypeToSynonyms constructor. |