function Entity::getKey

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

Returns a specific entity key.

Parameters

string $key: The name of the entity key to return.

Return value

string|bool The entity key, or FALSE if it does not exist.

See also

\Drupal\Core\Entity\EntityTypeInterface::getKeys()

14 calls to Entity::getKey()
Entity::getBundle in core/modules/migrate/src/Plugin/migrate/destination/Entity.php
Gets the bundle for the row taking into account the default.
Entity::getEntity in core/modules/migrate/src/Plugin/migrate/destination/Entity.php
Creates or loads an entity.
Entity::getEntityId in core/modules/migrate/src/Plugin/migrate/destination/Entity.php
Gets the entity ID of the row.
EntityConfigBase::getIds in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
Gets the destination IDs.
EntityConfigBase::import in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
Import the row.

... See full list

File

core/modules/migrate/src/Plugin/migrate/destination/Entity.php, line 201

Class

Entity
Provides a generic destination to import entities.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

protected function getKey($key) {
    return $this->storage
        ->getEntityType()
        ->getKey($key);
}

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