function AddFormBase::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.
3 calls to AddFormBase::getSourceFieldName()
- AddFormBase::buildEntityFormElement in core/modules/ media_library/ src/ Form/ AddFormBase.php 
- Builds the sub-form for setting required fields on a new media item.
- AddFormBase::processInputValues in core/modules/ media_library/ src/ Form/ AddFormBase.php 
- Creates media items from source field input values.
- FileUploadForm::buildEntityFormElement in core/modules/ media_library/ src/ Form/ FileUploadForm.php 
- Builds the sub-form for setting required fields on a new media item.
File
- 
              core/modules/ media_library/ src/ Form/ AddFormBase.php, line 796 
Class
- AddFormBase
- Provides a base class for creating media items from within the media library.
Namespace
Drupal\media_library\FormCode
protected function getSourceFieldName(MediaTypeInterface $media_type) {
  return $media_type->getSource()
    ->getSourceFieldDefinition($media_type)
    ->getName();
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
