You are here

protected static function AcquiaDAMStreamWrapper::getAssetIdFromUri in Media: Acquia DAM 7

Get an asset ID from an Acquia DAM Uri.

Parameters

string $uri: The URI to parse for an asset ID.

Return value

int|false The asset ID or FALSE on failure.

1 call to AcquiaDAMStreamWrapper::getAssetIdFromUri()
AcquiaDAMStreamWrapper::getAssetByUri in includes/AcquiaDAMStreamWrapper.inc
Load an asset by the Uri.

File

includes/AcquiaDAMStreamWrapper.inc, line 217
Create an Acquia DAM Stream Wrapper class for the Media/Resource module.

Class

AcquiaDAMStreamWrapper
Provides a remote stream wrapper for Acquia DAM assets.

Code

protected static function getAssetIdFromUri($uri) {
  $target = file_uri_target($uri);
  list($asset_id) = explode('.', drupal_basename($target), 2);
  $asset_id = intval($asset_id);
  return empty($asset_id) ? FALSE : $asset_id;
}