You are here

public function Media::getSource in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media/src/Entity/Media.php \Drupal\media\Entity\Media::getSource()

Returns the media source.

Return value

\Drupal\media\MediaSourceInterface The media source.

Overrides MediaInterface::getSource

6 calls to Media::getSource()
Media::getName in core/modules/media/src/Entity/Media.php
Gets the media item name.
Media::getThumbnailUri in core/modules/media/src/Entity/Media.php
Gets the URI for the thumbnail of a media item.
Media::hasSourceFieldChanged in core/modules/media/src/Entity/Media.php
Determines if the source field value has changed.
Media::prepareSave in core/modules/media/src/Entity/Media.php
Sets the media entity's field values from the source's metadata.
Media::updateThumbnail in core/modules/media/src/Entity/Media.php
Update the thumbnail for the media item.

... See full list

File

core/modules/media/src/Entity/Media.php, line 136

Class

Media
Defines the media entity class.

Namespace

Drupal\media\Entity

Code

public function getSource() {
  return $this->bundle->entity
    ->getSource();
}