function EntityFieldDefinitionTrait::getEntityTypeId

Same name in other branches
  1. 9 core/modules/migrate/src/EntityFieldDefinitionTrait.php \Drupal\migrate\EntityFieldDefinitionTrait::getEntityTypeId()
  2. 8.9.x core/modules/migrate/src/EntityFieldDefinitionTrait.php \Drupal\migrate\EntityFieldDefinitionTrait::getEntityTypeId()
  3. 11.x 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.

8 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)) {
        [
            ,
            $entity_type_id,
        ] = explode(static::DERIVATIVE_SEPARATOR, $plugin_id, 2);
    }
    return $entity_type_id;
}

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