Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
SetNullOnDeleteParentDefinition example
private
EntityRepository
$repository
;
private
Connection
$connection
;
protected
function
setUp
(
)
: void
{
$this
->writer =
$this
->
getContainer
(
)
->
get
(
EntityWriter::
class
)
;
$this
->connection =
$this
->
getContainer
(
)
->
get
(
Connection::
class
)
;
$registry
=
$this
->
getContainer
(
)
->
get
(
DefinitionInstanceRegistry::
class
)
;
$registry
->
register
(
new
SetNullOnDeleteParentDefinition
(
)
)
;
$registry
->
register
(
new
SetNullOnDeleteManyToOneDefinition
(
)
)
;
$registry
->
register
(
new
SetNullOnDeleteChildDefinition
(
)
)
;
$this
->repository =
new
EntityRepository
(
$this
->
getContainer
(
)
->
get
(
SetNullOnDeleteParentDefinition::
class
)
,
$this
->
getContainer
(
)
->
get
(
EntityReaderInterface::
class
)
,
$this
->
getContainer
(
)
->
get
(
VersionManager::
class
)
,
$this
->
getContainer
(
)
->
get
(
EntitySearcherInterface::
class
)
,
$this
->
getContainer
(
)
->
get
(
EntityAggregatorInterface::
class
)
,
$this
->
getContainer
(
)
->
get
(
'event_dispatcher'
)
,
$this
->
getContainer
(
)
->
get
(
EntityLoadedEventFactory::
class
)
)
;