You are here

class FieldTypeManager in Tooltip Taxonomy 8

The class for the field type manager.

@author Mingsong Hu

Hierarchy

Expanded class hierarchy of FieldTypeManager

1 file declares its use of FieldTypeManager
FilterConditionForm.php in src/Form/FilterConditionForm.php
1 string reference to 'FieldTypeManager'
tooltip_taxonomy.services.yml in ./tooltip_taxonomy.services.yml
tooltip_taxonomy.services.yml
1 service uses FieldTypeManager
tooltip_taxonomy.field_type_manager in ./tooltip_taxonomy.services.yml
\Drupal\tooltip_taxonomy\Services\FieldTypeManager

File

src/Services/FieldTypeManager.php, line 10

Namespace

Drupal\tooltip_taxonomy\Services
View 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

Namesort descending Modifiers Type Description Overrides
FieldTypeManager::isContentField public function Check if a field is content field.
FieldTypeManager::isTextField public function Check if the field is text field,.
FieldTypeManager::TEXT_FIELD_TYPES protected constant