function EntityConfigBase::generateId

Same name in other branches
  1. 8.9.x core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php \Drupal\migrate\Plugin\migrate\destination\EntityConfigBase::generateId()
  2. 10 core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php \Drupal\migrate\Plugin\migrate\destination\EntityConfigBase::generateId()
  3. 11.x core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php \Drupal\migrate\Plugin\migrate\destination\EntityConfigBase::generateId()

Generates an entity ID.

Parameters

\Drupal\migrate\Row $row: The current row.

array $ids: The destination IDs.

Return value

string The generated entity ID.

1 call to EntityConfigBase::generateId()
EntityConfigBase::import in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
Import the row.

File

core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php, line 264

Class

EntityConfigBase
Base destination class for importing configuration entities.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

protected function generateId(Row $row, array $ids) {
    $id_values = [];
    foreach ($ids as $id) {
        if ($this->isTranslationDestination() && $id == 'langcode') {
            continue;
        }
        $id_values[] = $row->getDestinationProperty($id);
    }
    return implode('.', $id_values);
}

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