You are here

public static function BaseFieldOverride::loadByName in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php \Drupal\Core\Field\Entity\BaseFieldOverride::loadByName()

Loads a base field bundle override config entity.

Parameters

string $entity_type_id: ID of the entity type.

string $bundle: Bundle name.

string $field_name: Name of the field.

Return value

static The base field bundle override config entity if one exists for the provided field name, otherwise NULL.

3 calls to BaseFieldOverride::loadByName()
BaseFieldDefinition::getConfig in core/lib/Drupal/Core/Field/BaseFieldDefinition.php
Gets an object that can be saved in configuration.
ContentTranslationSettingsTest::testSettingsUI in core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
Tests that the settings UI works as expected.
NodeFieldOverridesTest::testFieldOverrides in core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php
Tests that field overrides work as expected.

File

core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php, line 240

Class

BaseFieldOverride
Defines the base field override entity.

Namespace

Drupal\Core\Field\Entity

Code

public static function loadByName($entity_type_id, $bundle, $field_name) {
  return \Drupal::entityTypeManager()
    ->getStorage('base_field_override')
    ->load($entity_type_id . '.' . $bundle . '.' . $field_name);
}