You are here

public function AssetData::isUpdatedAsset in Media: Acquia DAM 8

Check if the given asset is different than what is stored.

Parameters

\cweagans\webdam\Entity\Asset $asset: The current version of the asset.

bool $saveUpdatedVersion: TRUE to save the new version (if newer than the existing).

Return value

bool TRUE if the given asset is a different version than what has been stored.

File

src/AssetData.php, line 65

Class

AssetData
Acquia DAM Asset Data service implementation.

Namespace

Drupal\media_acquiadam

Code

public function isUpdatedAsset(Asset $asset, $saveUpdatedVersion = TRUE) {
  $current_version = intval($this
    ->get($asset->id, 'version'));
  $new_version = intval($asset->version);
  return $new_version !== $current_version;
}