Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setDistinguishableName example
}
public
function
addDistinguishablePaymentName
(
EntityLoadedEvent
$event
)
: void
{
/** @var PaymentMethodEntity $payment */
foreach
(
$event
->
getEntities
(
)
as
$payment
)
{
if
(
$payment
->
getTranslation
(
'distinguishableName'
)
=== null
)
{
$payment
->
addTranslated
(
'distinguishableName',
$payment
->
getTranslation
(
'name'
)
)
;
}
if
(
$payment
->
getDistinguishableName
(
)
=== null
)
{
$payment
->
setDistinguishableName
(
$payment
->
getName
(
)
)
;
}
}
}
}