You are here

public function AppCredentialControllerBase::deleteApiProduct in Apigee Edge 8

File

src/Entity/Controller/AppCredentialControllerBase.php, line 159

Class

AppCredentialControllerBase
Base class for developer- and company app credential controller services.

Namespace

Drupal\apigee_edge\Entity\Controller

Code

public function deleteApiProduct(string $consumer_key, string $api_product) : AppCredentialInterface {
  $credential = $this
    ->decorated()
    ->deleteApiProduct($consumer_key, $api_product);
  $this->eventDispatcher
    ->dispatch(AppCredentialDeleteApiProductEvent::EVENT_NAME, new AppCredentialDeleteApiProductEvent($this
    ->getAppType(), $this->owner, $this->appName, $credential, $api_product));

  // By removing app from cache we force reload the credentials as well.
  $this->appCacheByOwner
    ->removeEntities([
    $this->appName,
  ]);
  return $credential;
}