You are here

public function AppCredentialControllerBase::delete in Apigee Edge 8

File

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

Class

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

Namespace

Drupal\apigee_edge\Entity\Controller

Code

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

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