Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
testIndex example
foreach
(
$templates
as
$template
)
{
$template
->
setTemplate
(
''
)
;
}
$data
=
array_map
(
static
fn
(
string
$templateId
)
: array =>
[
'id' =>
$templateId
,
'template' => null,
]
,
$templates
->
getIds
(
)
)
;
$templateRepository
->
upsert
(
array_values
(
$data
)
, Context::
createDefaultContext
(
)
)
;
$this
->
testIndex
(
0
)
;
}
private
function
getSeoUrls
(
string
$salesChannelId
, string
$productId
)
: SeoUrlCollection
{
/** @var EntityRepository $repo */
$repo
=
$this
->
getContainer
(
)
->
get
(
'seo_url.repository'
)
;
$criteria
=
new
Criteria
(
)
;
$criteria
->
addFilter
(
new
EqualsFilter
(
'salesChannelId',
$salesChannelId
)
)
;
$criteria
->
addFilter
(
new
EqualsFilter
(
'foreignKey',
$productId
)
)
;