Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
includeInactive example
->
addAssociation
(
'productStream.filters.queries'
)
->
addFilter
(
new
MultiFilter
(
'OR',
[
new
EqualsFilter
(
'salesChannelId',
$context
->
getSalesChannel
(
)
->
getId
(
)
)
,
new
EqualsFilter
(
'salesChannelDomain.salesChannel.id',
$context
->
getSalesChannel
(
)
->
getId
(
)
)
,
]
)
)
;
if
(
!
$behavior
->
includeInactive
(
)
)
{
$criteria
->
addFilter
(
new
EqualsFilter
(
'salesChannel.active', true
)
)
;
}
/** @var ProductExportCollection $productExports */
$productExports
=
$this
->productExportRepository->
search
(
$criteria
,
$context
->
getContext
(
)
)
;
if
(
$productExports
->
count
(
)
=== 0
)
{
$exportNotFoundException
=
new
ExportNotFoundException
(
$productExportId
)
;
$this
->
logException
(
$context
->
getContext
(
)
,
$exportNotFoundException
)
;
throw
$exportNotFoundException
;
}