function EntityNodeType::getEntity

Same name in other branches
  1. 10 core/modules/node/src/Plugin/migrate/destination/EntityNodeType.php \Drupal\node\Plugin\migrate\destination\EntityNodeType::getEntity()

Overrides Entity::getEntity

File

core/modules/node/src/Plugin/migrate/destination/EntityNodeType.php, line 18

Class

EntityNodeType
Migration destination for node type entity.

Namespace

Drupal\node\Plugin\migrate\destination

Code

public function getEntity(Row $row, array $old_destination_id_values) {
    
    /** @var \Drupal\node\NodeTypeInterface $node_type */
    $node_type = parent::getEntity($row, $old_destination_id_values);
    // Config schema does not allow description or help text to be empty.
    if ($node_type->getDescription() === '') {
        $node_type->set('description', NULL);
    }
    if ($node_type->getHelp() === '') {
        $node_type->set('help', NULL);
    }
    return $node_type;
}

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