public function AppCredentialControllerBase::addProducts in Apigee Edge 8
File
- src/
Entity/ Controller/ AppCredentialControllerBase.php, line 118
Class
- AppCredentialControllerBase
- Base class for developer- and company app credential controller services.
Namespace
Drupal\apigee_edge\Entity\ControllerCode
public function addProducts(string $consumer_key, array $api_products) : AppCredentialInterface {
$credential = $this
->decorated()
->addProducts($consumer_key, $api_products);
$this->eventDispatcher
->dispatch(AppCredentialAddApiProductEvent::EVENT_NAME, new AppCredentialAddApiProductEvent($this
->getAppType(), $this->owner, $this->appName, $credential, $api_products));
// By removing app from cache we force reload the credentials as well.
$this->appCacheByOwner
->removeEntities([
$this->appName,
]);
return $credential;
}