function EntityTaxonomyVocabulary::getEntity

Same name in other branches
  1. 11.x core/modules/taxonomy/src/Plugin/migrate/destination/EntityTaxonomyVocabulary.php \Drupal\taxonomy\Plugin\migrate\destination\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;
}

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