You are here

protected static function EntityFieldDefinitionTrait::getEntityTypeId in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/EntityFieldDefinitionTrait.php \Drupal\migrate\EntityFieldDefinitionTrait::getEntityTypeId()

Finds the entity type from configuration or plugin ID.

Parameters

string $plugin_id: The plugin ID.

Return value

string The entity type.

7 calls to EntityFieldDefinitionTrait::getEntityTypeId()
Entity::create in core/modules/migrate/src/Plugin/migrate/destination/Entity.php
Creates an instance of the plugin.
EntityComment::create in core/modules/comment/src/Plugin/migrate/destination/EntityComment.php
Creates an instance of the plugin.
EntityConfigBase::create in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
Creates an instance of the plugin.
EntityContentBase::create in core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
Creates an instance of the plugin.
EntityFieldDefinitionTrait::getDefinitionFromEntity in core/modules/migrate/src/EntityFieldDefinitionTrait.php
Gets the field definition from a specific entity base field.

... See full list

3 methods override EntityFieldDefinitionTrait::getEntityTypeId()
Book::getEntityTypeId in core/modules/book/src/Plugin/migrate/destination/Book.php
Finds the entity type from configuration or plugin ID.
EntityRevisionTestDestination::getEntityTypeId in core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php
Finds the entity type from configuration or plugin ID.
EntityTestDestination::getEntityTypeId in core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
Finds the entity type from configuration or plugin ID.

File

core/modules/migrate/src/EntityFieldDefinitionTrait.php, line 48

Class

EntityFieldDefinitionTrait
The entity field definition trait.

Namespace

Drupal\migrate

Code

protected static function getEntityTypeId($plugin_id) {
  $entity_type_id = NULL;
  if (strpos($plugin_id, static::DERIVATIVE_SEPARATOR)) {
    list(, $entity_type_id) = explode(static::DERIVATIVE_SEPARATOR, $plugin_id, 2);
  }
  return $entity_type_id;
}