You are here

public function FieldDefinition::getName in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/FieldDefinition.php \Drupal\Core\Field\FieldDefinition::getName()
  2. 9 core/lib/Drupal/Core/Field/FieldDefinition.php \Drupal\Core\Field\FieldDefinition::getName()

Returns the machine name of the field.

This defines how the field data is accessed from the entity. For example, if the field name is "foo", then $entity->foo returns its data.

Return value

string The field name.

Overrides FieldDefinitionInterface::getName

1 call to FieldDefinition::getName()
FieldDefinition::getUniqueIdentifier in core/lib/Drupal/Core/Field/FieldDefinition.php
Returns a unique identifier for the field.

File

core/lib/Drupal/Core/Field/FieldDefinition.php, line 64

Class

FieldDefinition
A class for defining entity field definitions.

Namespace

Drupal\Core\Field

Code

public function getName() {
  return $this
    ->getFieldStorageDefinition()
    ->getName();
}