You are here

public function MediaTypeBase::getDefaultName in Media entity 8

Provide a default name for the media.

Plugins defining media bundles are suggested to override this method and provide a default name, to be used when there is no user-defined label available.

Parameters

\Drupal\media_entity\MediaInterface $media: The media object.

Return value

string The string that should be used as default media name.

Overrides MediaTypeInterface::getDefaultName

File

src/MediaTypeBase.php, line 157

Class

MediaTypeBase
Base implementation of media type plugin.

Namespace

Drupal\media_entity

Code

public function getDefaultName(MediaInterface $media) {
  return 'media:' . $media
    ->bundle() . ':' . $media
    ->uuid();
}