Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isTestMode example
if
(
$event
->
isPropagationStopped
(
)
)
{
return
null;
}
$definition
=
$this
->
getValidationDefinition
(
$context
)
;
$this
->dataValidator->
validate
(
$data
,
$definition
)
;
$recipients
=
$data
[
'recipients'
]
;
$salesChannelId
=
$data
[
'salesChannelId'
]
;
$salesChannel
= null;
if
(
(
$salesChannelId
!== null && !
isset
(
$templateData
[
'salesChannel'
]
)
)
||
$this
->
isTestMode
(
$data
)
)
{
$criteria
=
$this
->
getSalesChannelDomainCriteria
(
$salesChannelId
,
$context
)
;
/** @var SalesChannelEntity|null $salesChannel */
$salesChannel
=
$this
->salesChannelRepository->
search
(
$criteria
,
$context
)
->
get
(
$salesChannelId
)
;
if
(
$salesChannel
=== null
)
{
throw
new
SalesChannelNotFoundException
(
$salesChannelId
)
;
}
$templateData
[
'salesChannel'
]
=
$salesChannel
;
}
elseif
(
$this
->
templateDataContainsSalesChannel
(
$templateData
)
)
{