Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Entity.php

function Entity::getBundle

Gets the bundle for the row taking into account the default.

Parameters

\Drupal\migrate\Row $row: The current row we're importing.

Return value

string The bundle for this row.

2 calls to Entity::getBundle()
Entity::getEntity in core/modules/migrate/src/Plugin/migrate/destination/Entity.php
Creates or loads an entity.
EntityContentComplete::getEntity in core/modules/migrate/src/Plugin/migrate/destination/EntityContentComplete.php
Gets the entity.

File

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

Class

Entity
Provides a generic destination to import entities.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

public function getBundle(Row $row) {
    $default_bundle = $this->configuration['default_bundle'] ?? '';
    $bundle_key = $this->getKey('bundle');
    return $row->getDestinationProperty($bundle_key) ?: $default_bundle;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal