Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createSingleContentTypeUrl example
private
function
createUrls
(
Type
$type
)
: void
{
$shops
=
$this
->
getModelManager
(
)
->
getRepository
(
Shop::
class
)
->
getActiveShopsFixed
(
)
;
$seoIndexer
=
$this
->
get
(
'seoindex'
)
;
$rewriteTable
=
$this
->
get
(
'modules'
)
->
RewriteTable
(
)
;
foreach
(
$shops
as
$shop
)
{
$seoIndexer
->
registerShop
(
$shop
->
getId
(
)
)
;
$rewriteTable
->
baseSetup
(
)
;
$rewriteTable
->
createSingleContentTypeUrl
(
$type
)
;
}
}
/** * @return list<array{name: string, url: string}> */
private
function
getUrls
(
Type
$type
)
: array
{
$shops
=
$this
->
getModelManager
(
)
->
getRepository
(
Shop::
class
)
->
getActiveShopsFixed
(
)
;
$urls
=
[
]
;