Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createLanguageIndex example
private
function
init
(
)
: IndexerOffset
{
$this
->connection->
executeStatement
(
'DELETE FROM elasticsearch_index_task'
)
;
$this
->
createScripts
(
)
;
$languages
=
$this
->languageProvider->
getLanguages
(
Context::
createDefaultContext
(
)
)
;
$timestamp
=
new
\
DateTime
(
)
;
foreach
(
$languages
as
$language
)
{
$this
->
createLanguageIndex
(
$language
,
$timestamp
)
;
}
return
new
IndexerOffset
(
array_values
(
$languages
->
getIds
(
)
)
,
$this
->registry->
getDefinitionNames
(
)
,
$timestamp
->
getTimestamp
(
)
)
;
}
/** * @param array<mixed> $result * * @return array{index: string, id: string, type: string, reason: string}[] */