Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
loopOperations example
public
function
sync
(
array
$operations
, Context
$context
, SyncBehavior
$behavior
)
: SyncResult
{
ReplicaConnection::
ensurePrimary
(
)
;
$context
=
clone
$context
;
$this
->
loopOperations
(
$operations
,
$context
)
;
if
(
\
count
(
$behavior
->
getSkipIndexers
(
)
)
)
{
$context
->
addExtension
(
EntityIndexerRegistry::EXTENSION_INDEXER_SKIP,
new
ArrayEntity
(
[
'skips' =>
$behavior
->
getSkipIndexers
(
)
]
)
)
;
}
if
(
$behavior
->
getIndexingBehavior
(
)
!== null
&& \
in_array
(
$behavior
->
getIndexingBehavior
(
)
,
[
EntityIndexerRegistry::DISABLE_INDEXING, EntityIndexerRegistry::USE_INDEXING_QUEUE
]
, true
)
)
{
$context
->
addState
(
$behavior
->
getIndexingBehavior
(
)
)
;
}