protected function populateParametersWithWidgetFields(Widget $widget, $entity, &$parameters) { $fields = $widget->getFields(); //parse the field foreach ($fields as $widgetField => $field) { //get the value of the field if ($entity !== null) { $attributeValue = $entity->getEntityAttributeValue($field); } else { $attributeValue = $widget->getBusinessEntityName() . ' -> ' . $field; } $parameters[$widgetField] = $attributeValue; } }