CodeExplorer enrichInstallMetadata example
$this->
ensureIsCompatible($manifest);
$app =
$this->
loadAppByName($manifest->
getMetadata()->
getName(),
$context);
if ($app) { throw AppException::
alreadyInstalled($manifest->
getMetadata()->
getName());
} $defaultLocale =
$this->
getDefaultLocale($context);
$metadata =
$manifest->
getMetadata()->
toArray($defaultLocale);
$appId = Uuid::
randomHex();
$roleId = Uuid::
randomHex();
$metadata =
$this->
enrichInstallMetadata($manifest,
$metadata,
$roleId);
$app =
$this->
updateApp($manifest,
$metadata,
$appId,
$roleId,
$defaultLocale,
$context, true
);
$event =
new AppInstalledEvent($app,
$manifest,
$context);
$this->eventDispatcher->
dispatch($event);
$this->scriptExecutor->
execute(new AppInstalledHook($event));
if ($activate) { $this->appStateService->
activateApp($appId,
$context);
}