You are here

protected function Media::hasSourceFieldChanged in Drupal 8

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

Determines if the source field value has changed.

@internal

Return value

bool TRUE if the source field value changed, FALSE otherwise.

1 call to Media::hasSourceFieldChanged()
Media::shouldUpdateThumbnail in core/modules/media/src/Entity/Media.php
Determines if the thumbnail should be updated for a media item.

File

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

Class

Media
Defines the media entity class.

Namespace

Drupal\media\Entity

Code

protected function hasSourceFieldChanged() {
  $source_field_name = $this
    ->getSource()
    ->getConfiguration()['source_field'];
  $current_items = $this
    ->get($source_field_name);
  return isset($this->original) && !$current_items
    ->equals($this->original
    ->get($source_field_name));
}