function MediaSourceInterface::getSourceFieldValue

Same name and namespace in other branches
  1. 8.9.x core/modules/media/src/MediaSourceInterface.php \Drupal\media\MediaSourceInterface::getSourceFieldValue()
  2. 10 core/modules/media/src/MediaSourceInterface.php \Drupal\media\MediaSourceInterface::getSourceFieldValue()
  3. 11.x core/modules/media/src/MediaSourceInterface.php \Drupal\media\MediaSourceInterface::getSourceFieldValue()

Get the primary value stored in the source field.

Parameters

MediaInterface $media: A media item.

Return value

mixed The source value, or NULL if the media item's source field is empty.

Throws

\RuntimeException If the source field for the media source is not defined.

1 method overrides MediaSourceInterface::getSourceFieldValue()
MediaSourceBase::getSourceFieldValue in core/modules/media/src/MediaSourceBase.php
Get the primary value stored in the source field.

File

core/modules/media/src/MediaSourceInterface.php, line 193

Class

MediaSourceInterface
Defines the interface for media source plugins.

Namespace

Drupal\media

Code

public function getSourceFieldValue(MediaInterface $media);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.