Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ConfigurationStruct example
$configuration
=
$this
->
getTableConfiguration
(
$table
)
;
$items
=
[
]
;
foreach
(
$columns
as
$column
)
{
$name
=
strtolower
(
$column
->
getName
(
)
)
;
$default
=
$column
->
getDefault
(
)
;
if
(
$default
=== 'NULL'
)
{
$default
= null;
}
$item
=
new
ConfigurationStruct
(
)
;
$item
->
setTableName
(
$table
)
;
$item
->
setColumnName
(
$column
->
getName
(
)
)
;
$item
->
setIdentifier
(
$this
->tableMapping->
isIdentifierColumn
(
$table
,
$column
->
getName
(
)
)
)
;
$item
->
setCore
(
$this
->tableMapping->
isCoreColumn
(
$table
,
$column
->
getName
(
)
)
)
;
$item
->
setColumnType
(
$this
->typeMapping->
dbalToUnified
(
$column
->
getType
(
)
)
)
;
$item
->
setElasticSearchType
(
$this
->typeMapping->
unifiedToElasticSearch
(
$item
->
getColumnType
(
)
)
)
;
$item
->
setDefaultValue
(
$default
)
;
if
(
isset
(
$configuration
[
$name
]
)
)
{
$config
=
$configuration
[
$name
]
;
$item
->
setId
(
(int)
$config
[
'id'
]
)
;