You are here

protected function MediaEditForm::getSourceFieldName in Media Directories 8

Same name and namespace in other branches
  1. 3.x modules/media_directories_ui/src/Form/MediaEditForm.php \Drupal\media_directories_ui\Form\MediaEditForm::getSourceFieldName()
  2. 2.x modules/media_directories_ui/src/Form/MediaEditForm.php \Drupal\media_directories_ui\Form\MediaEditForm::getSourceFieldName()

Returns the name of the source field for a media type.

Parameters

\Drupal\media\MediaTypeInterface $media_type: The media type to get the source field name for.

Return value

string The name of the media type's source field.

Overrides AddMediaFormBase::getSourceFieldName

File

modules/media_directories_ui/src/Form/MediaEditForm.php, line 163

Class

MediaEditForm
Class MediaEditForm.

Namespace

Drupal\media_directories_ui\Form

Code

protected function getSourceFieldName(MediaTypeInterface $media_type) {
  return $media_type
    ->getSource()
    ->getSourceFieldDefinition($media_type)
    ->getName();
}