class FieldTypeManager in Tooltip Taxonomy 8
The class for the field type manager.
@author Mingsong Hu
Hierarchy
- class \Drupal\tooltip_taxonomy\Services\FieldTypeManager
Expanded class hierarchy of FieldTypeManager
1 file declares its use of FieldTypeManager
- FilterConditionForm.php in src/
Form/ FilterConditionForm.php
1 string reference to 'FieldTypeManager'
1 service uses FieldTypeManager
File
- src/
Services/ FieldTypeManager.php, line 10
Namespace
Drupal\tooltip_taxonomy\ServicesView source
class FieldTypeManager {
protected const TEXT_FIELD_TYPES = [
'text',
'text_long',
'text_with_summary',
'string_long',
];
/**
* Check if the field is text field,.
*
* @param string $field_type
* Type of field.
*/
public function isTextField($field_type) {
return in_array($field_type, static::TEXT_FIELD_TYPES);
}
/**
* Check if a field is content field.
*
* @param string $field_name
* The name of the field.
*/
public function isContentField($field_name) {
return $field_name === 'body' || strpos($field_name, 'field_') === 0;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FieldTypeManager:: |
public | function | Check if a field is content field. | |
FieldTypeManager:: |
public | function | Check if the field is text field,. | |
FieldTypeManager:: |
protected | constant |