function ContentEntity::getIds

Same name in other branches
  1. 8.9.x core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntity::getIds()
  2. 10 core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntity::getIds()
  3. 11.x core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntity::getIds()

Overrides MigrateSourceInterface::getIds

1 call to ContentEntity::getIds()
ContentEntity::toArray in core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php
Converts an entity to an array.

File

core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php, line 285

Class

ContentEntity
Source plugin to get content entities from the current version of Drupal.

Namespace

Drupal\migrate_drupal\Plugin\migrate\source

Code

public function getIds() {
    $id_key = $this->entityType
        ->getKey('id');
    $ids[$id_key] = $this->getDefinitionFromEntity($id_key);
    if ($this->configuration['add_revision_id'] && $this->entityType
        ->isRevisionable()) {
        $revision_key = $this->entityType
            ->getKey('revision');
        $ids[$revision_key] = $this->getDefinitionFromEntity($revision_key);
    }
    if ($this->entityType
        ->isTranslatable()) {
        $langcode_key = $this->entityType
            ->getKey('langcode');
        $ids[$langcode_key] = $this->getDefinitionFromEntity($langcode_key);
    }
    return $ids;
}

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