Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setProfileName example
Context
$context
,
string
$activity
,
ImportExportFileEntity
$file
,
ImportExportProfileEntity
$profile
,
array
$config
)
: ImportExportLogEntity
{
$logEntity
=
new
ImportExportLogEntity
(
)
;
$logEntity
->
setId
(
Uuid::
randomHex
(
)
)
;
$logEntity
->
setActivity
(
$activity
)
;
$logEntity
->
setState
(
Progress::STATE_PROGRESS
)
;
$logEntity
->
setProfileId
(
$profile
->
getId
(
)
)
;
$logEntity
->
setProfileName
(
$profile
->
getTranslation
(
'label'
)
)
;
$logEntity
->
setFileId
(
$file
->
getId
(
)
)
;
$logEntity
->
setRecords
(
0
)
;
$logEntity
->
setConfig
(
$this
->
getConfig
(
$profile
,
$config
)
)
;
$contextSource
=
$context
->
getSource
(
)
;
$userId
=
$contextSource
instanceof AdminApiSource ?
$contextSource
->
getUserId
(
)
: null;
if
(
$userId
!== null
)
{
$logEntity
->
setUsername
(
$this
->
findUser
(
$context
,
$userId
)
->
getUsername
(
)
)
;
$logEntity
->
setUserId
(
$userId
)
;
}