function EntityTaxonomyVocabulary::getEntity
Same name and namespace in other branches
- 11.x core/modules/taxonomy/src/Plugin/migrate/destination/EntityTaxonomyVocabulary.php \Drupal\taxonomy\Plugin\migrate\destination\EntityTaxonomyVocabulary::getEntity()
Creates or loads an entity.
Parameters
\Drupal\migrate\Row $row: The row object.
array $old_destination_id_values: The old destination IDs.
Return value
\Drupal\Core\Entity\EntityInterface The entity we are importing into.
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\destinationCode
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.