FieldConfig::loadByName

public static FieldConfig::loadByName($entity_type_id, $bundle, $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 $bundle: Bundle name.

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/FieldConfig.php, line 340

Class

FieldConfig
Defines the Field entity.

Namespace

Drupal\field\Entity

Code

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

Please login to continue.