Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
DefaultsChildTranslationDefinition example
$connection
->
executeStatement
(
DefaultsDefinition::SCHEMA
)
;
$connection
->
executeStatement
(
DefaultsChildDefinition::SCHEMA
)
;
$connection
->
executeStatement
(
DefaultsChildTranslationDefinition::SCHEMA
)
;
$this
->
startTransactionBefore
(
)
;
$defaultsDefinition
=
new
DefaultsDefinition
(
)
;
$definitions
=
$this
->
getContainer
(
)
->
get
(
DefinitionInstanceRegistry::
class
)
;
$definitions
->
register
(
$defaultsDefinition
)
;
$definitions
->
register
(
new
DefaultsChildDefinition
(
)
)
;
$definitions
->
register
(
new
DefaultsChildTranslationDefinition
(
)
)
;
}
protected
function
tearDown
(
)
: void
{
$this
->
stopTransactionAfter
(
)
;
$connection
=
$this
->
getContainer
(
)
->
get
(
Connection::
class
)
;
$connection
->
executeStatement
(
'DROP TABLE IF EXISTS ' . EntityDefinitionQueryHelper::
escape
(
'defaults_child_translation'
)
)
;
$connection
->
executeStatement
(
'DROP TABLE IF EXISTS ' . EntityDefinitionQueryHelper::
escape
(
'defaults_child'
)
)
;
$connection
->
executeStatement
(
'DROP TABLE IF EXISTS ' . EntityDefinitionQueryHelper::
escape
(
'defaults'
)
)
;