Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setModelManager example
$stringCompiler
=
new
Shopware_Components_StringCompiler
(
$container
->
get
(
Enlight_Template_Manager::
class
)
)
;
$mailer
=
new
Shopware_Components_TemplateMail
(
)
;
if
(
$container
->
initialized
(
'shop'
)
)
{
$shop
=
$container
->
get
(
'shop'
)
;
if
(
!
$shop
instanceof Shop
)
{
throw
new
RuntimeException
(
'Shop object not found in DI container'
)
;
}
$mailer
->
setShop
(
$shop
)
;
}
$mailer
->
setModelManager
(
$container
->
get
(
ModelManager::
class
)
)
;
$mailer
->
setStringCompiler
(
$stringCompiler
)
;
return
$mailer
;
}
}