You are here

public function BynderMediaApi::removeAssetUsage in Bynder 7

File

includes/BynderMediaApi.inc, line 275
Manages the Bynder media browser functionality

Class

BynderMediaApi

Code

public function removeAssetUsage($assetID, $usageUrl = null) {
  try {
    $usageProperties = [
      'integration_id' => self::BYNDER_INTEGRATION_ID,
      'asset_id' => $assetID,
      'uri' => $usageUrl,
    ];
    return $this->assetBankManager
      ->deleteUSage($usageProperties)
      ->wait();
  } catch (Exception $e) {
    watchdog('bynder', $e
      ->getMessage());
    drupal_set_message(t('Could not add asset usage information'), 'error');
    return false;
  }
}