Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
checkEntityNameConstant example
foreach
(
$this
->registry->
getDefinitions
(
)
as
$definition
)
{
// ignore definitions from a test namespace
if
(
preg_match
(
'/.*\\\\Test\\\\.*/',
$definition
->
getClass
(
)
)
||
preg_match
(
'/.*ComposerChild\\\\.*/',
$definition
->
getClass
(
)
)
)
{
continue
;
}
$violations
[
$definition
->
getClass
(
)
]
=
[
]
;
$violations
=
array_merge_recursive
(
$violations
,
$this
->
validateSchema
(
$definition
)
)
;
$violations
=
array_merge_recursive
(
$violations
,
$this
->
validateColumn
(
$definition
)
)
;
$violations
=
array_merge_recursive
(
$violations
,
$this
->
checkEntityNameConstant
(
$definition
)
)
;
$struct
= ArrayEntity::
class
;
if
(
!
$definition
instanceof MappingEntityDefinition
)
{
$struct
=
$definition
->
getEntityClass
(
)
;
}
if
(
$struct
!== ArrayEntity::
class
)
{
$violations
[
$definition
->
getClass
(
)
]
=
array_merge
(
$violations
[
$definition
->
getClass
(
)
]
,
$this
->
validateStruct
(
$struct
,
$definition
)
)
;