Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getIntegrationIdByAccessKey example
$clientId
=
$request
->attributes->
get
(
PlatformRequest::ATTRIBUTE_OAUTH_CLIENT_ID
)
;
$keyOrigin
= AccessKeyHelper::
getOrigin
(
$clientId
)
;
if
(
$keyOrigin
=== 'user'
)
{
$userId
=
$this
->
getUserIdByAccessKey
(
$clientId
)
;
return
$this
->
getAdminApiSource
(
$userId
)
;
}
if
(
$keyOrigin
=== 'integration'
)
{
$integrationId
=
$this
->
getIntegrationIdByAccessKey
(
$clientId
)
;
return
$this
->
getAdminApiSource
(
null,
$integrationId
)
;
}
if
(
$keyOrigin
=== 'sales-channel'
)
{
$salesChannelId
=
$this
->
getSalesChannelIdByAccessKey
(
$clientId
)
;
return
new
SalesChannelApiSource
(
$salesChannelId
)
;
}
return
new
SystemSource
(
)
;
}