// add all our set groups to our configuration
// if existing. always make sure to have at least a node
$payload['setGroups'
] =
[];
if ($promotion->
getSetgroups() !== null
) { foreach ($promotion->
getSetgroups() as $group) { $payload['setGroups'
][] =
[ 'groupId' =>
$group->
getId(),
'packagerKey' =>
$group->
getPackagerKey(),
'value' =>
$group->
getValue(),
'sorterKey' =>
$group->
getSorterKey(),
'rules' =>
$group->
getSetGroupRules(),
];
} } $payload['filter'
] =
[ 'sorterKey' => null,
'applierKey' => null,
'usageKey' => null,
'pickerKey' => null,
];