Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ensureIsCompatible example
private
readonly string
$env
)
{
}
public
function
getDecorated
(
)
: AbstractAppLifecycle
{
throw
new
DecorationPatternException
(
self::
class
)
;
}
public
function
install
(
Manifest
$manifest
, bool
$activate
, Context
$context
)
: void
{
$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
)
;