Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
EntityManagerHelper example
$this
->
registerTaggedServiceIds
(
)
;
if
(
!
$this
->skipDatabase
)
{
// Wrap database related logic in a try-catch // so that non-db commands can still execute
try
{
$em
=
$this
->kernel->
getContainer
(
)
->
get
(
ModelManager::
class
)
;
// Setup doctrine commands
$helperSet
=
$this
->
getHelperSet
(
)
;
$helperSet
->
set
(
new
EntityManagerHelper
(
$em
)
, 'em'
)
;
$helperSet
->
set
(
new
ConnectionHelper
(
$em
->
getConnection
(
)
)
, 'db'
)
;
DoctrineConsoleRunner::
addCommands
(
$this
)
;
$this
->
registerEventCommands
(
)
;
foreach
(
$this
->kernel->
getPlugins
(
)
as
$plugin
)
{
if
(
$plugin
->
isActive
(
)
)
{
$plugin
->
registerCommands
(
$this
)
;
}
}
}