Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
SalesChannelIndexerEvent example
$ids
=
$message
->
getData
(
)
;
$ids
=
array_unique
(
array_filter
(
$ids
)
)
;
if
(
empty
(
$ids
)
)
{
return
;
}
if
(
$message
->
allow
(
self::MANY_TO_MANY_UPDATER
)
)
{
$this
->manyToManyUpdater->
update
(
SalesChannelDefinition::ENTITY_NAME,
$ids
,
$message
->
getContext
(
)
)
;
}
$this
->eventDispatcher->
dispatch
(
new
SalesChannelIndexerEvent
(
$ids
,
$message
->
getContext
(
)
,
$message
->
getSkip
(
)
)
)
;
}
public
function
getTotal
(
)
: int
{
return
$this
->iteratorFactory->
createIterator
(
$this
->repository->
getDefinition
(
)
)
->
fetchCount
(
)
;
}
public
function
getDecorated
(
)
: EntityIndexer
{
throw
new
DecorationPatternException
(
static
::
class
)
;
}