You are here

public function MetadataGenerator::generateEntityMetadata in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/quickedit/src/MetadataGenerator.php \Drupal\quickedit\MetadataGenerator::generateEntityMetadata()

Generates in-place editing metadata for an entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity, in the language in which one of its fields is being edited.

Return value

array An array containing metadata with the following keys:

  • label: the user-visible label for the entity in the given language.

Overrides MetadataGeneratorInterface::generateEntityMetadata

File

core/modules/quickedit/src/MetadataGenerator.php, line 61
Contains \Drupal\quickedit\MetadataGenerator.

Class

MetadataGenerator
Generates in-place editing metadata for an entity field.

Namespace

Drupal\quickedit

Code

public function generateEntityMetadata(EntityInterface $entity) {
  return array(
    'label' => $entity
      ->label(),
  );
}