Skip to content
Snippets Groups Projects
Commit 8ba8d927 authored by Dimitris Bozelos's avatar Dimitris Bozelos
Browse files

Issue #3357787 Added support for exporting to Acumatica fields

parent d1048864
Branches
Tags
No related merge requests found
...@@ -9,8 +9,7 @@ use Drupal\Core\Entity\ContentEntityInterface; ...@@ -9,8 +9,7 @@ use Drupal\Core\Entity\ContentEntityInterface;
* Transformer that imports/exports the value of an Acumatica field. * Transformer that imports/exports the value of an Acumatica field.
* *
* Extracts the main property value of a field attached to an Acumatica * Extracts the main property value of a field attached to an Acumatica
* object. Currently only imports are supported, support for exports should be * object.
* added here as well.
* *
* Acumatica fields are similar to Drupal in that they contain their values in * Acumatica fields are similar to Drupal in that they contain their values in
* properties. This plugin currently works with simple fields that have one main * properties. This plugin currently works with simple fields that have one main
...@@ -27,7 +26,7 @@ use Drupal\Core\Entity\ContentEntityInterface; ...@@ -27,7 +26,7 @@ use Drupal\Core\Entity\ContentEntityInterface;
* parent object and we need to get the field object. The field * parent object and we need to get the field object. The field
* object first. The * object first. The
* - property_name: (string, optional, defaults to `value`) The name of the main * - property_name: (string, optional, defaults to `value`) The name of the main
* property of the Acumatica field being imported. * property of the Acumatica field being imported/exported.
* *
* @EntitySyncFieldTransformer( * @EntitySyncFieldTransformer(
* id = "acumatica_field" * id = "acumatica_field"
...@@ -44,6 +43,19 @@ class Field extends PluginBase { ...@@ -44,6 +43,19 @@ class Field extends PluginBase {
] + parent::defaultConfiguration(); ] + parent::defaultConfiguration();
} }
/**
* {@inheritdoc}
*/
protected function transformExportedValue(
$value,
ContentEntityInterface $local_entity,
$remote_entity_id,
array $field_info,
array $context
) {
return [$this->configuration['property_name'] => $value];
}
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment