Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
hasWrittenGermanTranslations example
$writeResult
=
$this
->
importTranslation
(
ProductSearchConfigDefinition::ENTITY_NAME,
$translations
,
$connection
)
;
$createdAt
=
(
new
\
DateTime
(
)
)
->
format
(
Defaults::STORAGE_DATE_TIME_FORMAT
)
;
$defaultSearchData
=
[
]
;
if
(
$writeResult
->
hasWrittenEnglishTranslations
(
)
)
{
$defaultSearchData
=
$this
->
getConfigFieldDefaultData
(
$searchConfigEnId
,
$createdAt
)
;
}
if
(
$writeResult
->
hasWrittenGermanTranslations
(
)
)
{
$defaultSearchData
=
[
...
$defaultSearchData
, ...
$this
->
getConfigFieldDefaultData
(
$searchConfigDeId
,
$createdAt
)
]
;
}
$queue
=
new
MultiInsertQueryQueue
(
$connection
, 250
)
;
foreach
(
$defaultSearchData
as
$searchData
)
{
$entityName
=
$searchData
[
'table'
]
;
unset
(
$searchData
[
'table'
]
)
;
$queue
->
addInsert
(
$entityName
,
$searchData
)
;
}