You are here

protected function Entity::getKey in Drupal 9

Same name and namespace in other branches
  1. 8 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);
}