class TaxonomyTermDisplayConfigurableTestHooks

Hook implementations for taxonomy_term_display_configurable_test.

Hierarchy

Expanded class hierarchy of TaxonomyTermDisplayConfigurableTestHooks

File

core/modules/taxonomy/tests/modules/taxonomy_term_display_configurable_test/src/Hook/TaxonomyTermDisplayConfigurableTestHooks.php, line 13

Namespace

Drupal\taxonomy_term_display_configurable_test\Hook
View source
class TaxonomyTermDisplayConfigurableTestHooks {
    
    /**
     * Implements hook_entity_base_field_info_alter().
     */
    public function entityBaseFieldInfoAlter(&$base_field_definitions, EntityTypeInterface $entity_type) {
        if ($entity_type->id() === 'taxonomy_term') {
            
            /** @var \Drupal\Core\Field\BaseFieldDefinition[] $base_field_definitions */
            $base_field_definitions['name']->setDisplayConfigurable('view', TRUE);
        }
    }
    
    /**
     * Implements hook_entity_type_build().
     */
    public function entityTypeBuild(array &$entity_types) {
        // Allow skipping of extra preprocessing for configurable display.
        $entity_types['taxonomy_term']->set('enable_base_field_custom_preprocess_skipping', TRUE);
    }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.