Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ThemeWithLabels example
private
function
getThemeConfig
(
)
: StorefrontPluginConfiguration
{
$factory
=
$this
->
getContainer
(
)
->
get
(
StorefrontPluginConfigurationFactory::
class
)
;
return
$factory
->
createFromBundle
(
new
ThemeWithFileAssociations
(
)
)
;
}
private
function
getThemeConfigWithLabels
(
)
: StorefrontPluginConfiguration
{
$factory
=
$this
->
getContainer
(
)
->
get
(
StorefrontPluginConfigurationFactory::
class
)
;
return
$factory
->
createFromBundle
(
new
ThemeWithLabels
(
)
)
;
}
private
function
getTheme
(
StorefrontPluginConfiguration
$bundle
, bool
$withChild
= false
)
: ThemeEntity
{
$criteria
=
new
Criteria
(
)
;
$criteria
->
addFilter
(
new
EqualsFilter
(
'technicalName',
$bundle
->
getTechnicalName
(
)
)
)
;
$criteria
->
addAssociation
(
'media'
)
;
$criteria
->
addAssociation
(
'translations.language.locale'
)
;
if
(
$withChild
)
{
$criteria
->
addAssociation
(
'dependentThemes'
)
;
}