FieldStorageConfig::loadByName

public static FieldStorageConfig::loadByName($entity_type_id, $field_name)

Loads a field config entity based on the entity type and field name.

Parameters

string $entity_type_id: ID of the entity type.

string $field_name: Name of the field.

Return value

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

File

core/modules/field/src/Entity/FieldStorageConfig.php, line 798

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

public static function loadByName($entity_type_id, $field_name) {
  return \Drupal::entityManager()->getStorage('field_storage_config')->load($entity_type_id . '.' . $field_name);
}
doc_Drupal
2016-10-29 09:12:23
Comments
Leave a Comment

Please login to continue.