Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getFieldsInWriteOrder example
/** * @param array<string, mixed> $rawData * * @return string[] */
public
function
extract
(
array
$rawData
, WriteParameterBag
$parameters
)
: array
{
$definition
=
$parameters
->
getDefinition
(
)
;
$fields
=
$this
->
getFieldsInWriteOrder
(
$definition
)
;
$pkData
=
$this
->
getPrimaryKey
(
$rawData
,
$parameters
)
;
/** @var Field&StorageAware $pkField */
foreach
(
$definition
->
getPrimaryKeys
(
)
as
$pkField
)
{
$parameters
->
getContext
(
)
->
set
(
$parameters
->
getDefinition
(
)
->
getEntityName
(
)
,
$pkField
->
getPropertyName
(
)
,
$pkField
->
getSerializer
(
)
->
decode
(
$pkField
,
$pkData
[
$pkField
->
getStorageName
(
)
]
)
,
)
;
}