function FieldDiscovery::getBundleFields

Same name in other branches
  1. 8.9.x core/modules/migrate_drupal/src/FieldDiscovery.php \Drupal\migrate_drupal\FieldDiscovery::getBundleFields()
  2. 10 core/modules/migrate_drupal/src/FieldDiscovery.php \Drupal\migrate_drupal\FieldDiscovery::getBundleFields()
  3. 11.x core/modules/migrate_drupal/src/FieldDiscovery.php \Drupal\migrate_drupal\FieldDiscovery::getBundleFields()

Gets all field information for a particular entity type and bundle.

Parameters

string $core: The Drupal core version.

string $entity_type_id: The legacy entity type ID.

string $bundle: The legacy bundle (or content_type).

Return value

array An array of source data from the relevant field instance migration for the bundle, keyed by field name.

1 call to FieldDiscovery::getBundleFields()
FieldDiscoveryTestClass::getBundleFields in core/modules/migrate_drupal/tests/modules/field_discovery_test/src/FieldDiscoveryTestClass.php
Gets all field information for a particular entity type and bundle.
1 method overrides FieldDiscovery::getBundleFields()
FieldDiscoveryTestClass::getBundleFields in core/modules/migrate_drupal/tests/modules/field_discovery_test/src/FieldDiscoveryTestClass.php
Gets all field information for a particular entity type and bundle.

File

core/modules/migrate_drupal/src/FieldDiscovery.php, line 260

Class

FieldDiscovery
Provides field discovery for Drupal 6 & 7 migrations.

Namespace

Drupal\migrate_drupal

Code

protected function getBundleFields($core, $entity_type_id, $bundle) {
    $fields = $this->getEntityFields($core, $entity_type_id);
    if (!empty($fields[$bundle])) {
        return $fields[$bundle];
    }
    return [];
}

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