Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Media.php

function Media::getName

Overrides MediaInterface::getName

1 call to Media::getName()
Media::label in core/modules/media/src/Entity/Media.php
Gets the label of the entity.

File

core/modules/media/src/Entity/Media.php, line 113

Class

Media
Defines the media entity class.

Namespace

Drupal\media\Entity

Code

public function getName() {
    $name = $this->getEntityKey('label');
    if (empty($name)) {
        $media_source = $this->getSource();
        return $media_source->getMetadata($this, $media_source->getPluginDefinition()['default_name_metadata_attribute']);
    }
    return $name;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal