You are here

public function BynderApi::removeAssetUsage in Bynder 4.0.x

Same name and namespace in other branches
  1. 8.3 src/BynderApi.php \Drupal\bynder\BynderApi::removeAssetUsage()
  2. 8 src/BynderApi.php \Drupal\bynder\BynderApi::removeAssetUsage()
  3. 8.2 src/BynderApi.php \Drupal\bynder\BynderApi::removeAssetUsage()

Removes asset usage entry for a specific Bynder asset.

Parameters

$asset_id: Bynder asset ID.

null $usage_url: Url where the asset is being used (node url).

Return value

mixed

Overrides BynderApiInterface::removeAssetUsage

1 method overrides BynderApi::removeAssetUsage()
BynderApiTest::removeAssetUsage in tests/modules/bynder_test_module/src/BynderApiTest.php
Sets values in state.

File

src/BynderApi.php, line 429

Class

BynderApi
Bynder API service.

Namespace

Drupal\bynder

Code

public function removeAssetUsage($asset_id, $usage_url = NULL) {
  $usageProperties = [
    'integration_id' => self::BYNDER_INTEGRATION_ID,
    'asset_id' => $asset_id,
    'uri' => $usage_url,
  ];
  return $this
    ->getAssetBankManager()
    ->deleteUsage($usageProperties)
    ->wait();
}