public function getSourceFieldName($media_type) {
    $bundle = $this->entityTypeManager->getStorage('media_type')->load($media_type);
    if (!$bundle) {
      throw new NotFoundHttpException("Bundle $media_type does not exist");
    }

    $type_configuration = $bundle->get('source_configuration');
    if (!isset($type_configuration['source_field'])) {
      return NULL;
    }

    return $type_configuration['source_field'];
  }
public function getSourceFieldName($media_type) {
    $bundle = $this->entityTypeManager->getStorage('media_type')->load($media_type);
    if (!$bundle) {
      throw new NotFoundHttpException("Bundle $media_type does not exist");
    }

    $type_configuration = $bundle->get('source_configuration');
    if (!isset($type_configuration['source_field'])) {
      return NULL;
    }

    return $type_configuration['source_field'];
  }
public function getSourceFieldName ( $ media_type ) { $ bundle = $ this -> entityTypeManager -> getStorage ( 'media_type' ) -> load ( $ media_type ) ; if ( ! $ bundle ) { throw new NotFoundHttpException ( "Bundle $media_type does not exist" ) ; } $ type_configuration = $ bundle -> get ( 'source_configuration' ) ; if ( ! isset ( $ type_configuration [ 'source_field' ] ) ) { return NULL ; } return $ type_configuration [ 'source_field' ] ; }
Gets the name of a source field for a Media.

@param string $media_type
Media bundle whose source field you are searching for.

@return string|null
Field name if it exists in configuration, else NULL.
Gets the name of a source field for a Media .