Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityTaxonomyVocabulary.php

function EntityTaxonomyVocabulary::getEntity

Overrides Entity::getEntity

File

core/modules/taxonomy/src/Plugin/migrate/destination/EntityTaxonomyVocabulary.php, line 20

Class

EntityTaxonomyVocabulary
Migration destination for taxonomy vocabulary.

Namespace

Drupal\taxonomy\Plugin\migrate\destination

Code

public function getEntity(Row $row, array $old_destination_id_values) {
    
    /** @var \Drupal\taxonomy\VocabularyInterface $vocabulary */
    $vocabulary = parent::getEntity($row, $old_destination_id_values);
    // Config schema does not allow description to be empty.
    if (trim($vocabulary->getDescription()) === '') {
        $vocabulary->set('description', NULL);
    }
    return $vocabulary;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal