Skip to content

Instantly share code, notes, and snippets.

@grena
Created January 20, 2021 11:42
Show Gist options
  • Save grena/7e874122debbc8eb9130f24c6b4107d5 to your computer and use it in GitHub Desktop.
Save grena/7e874122debbc8eb9130f24c6b4107d5 to your computer and use it in GitHub Desktop.
diff --git a/src/Webkul/PrestashopConnectorBundle/Controller/Rest/ExportMappingController.php b/src/Webkul/PrestashopConnectorBundle/Controller/Rest/ExportMappingController.php
index aa153d0..1391116 100644
--- a/src/Webkul/PrestashopConnectorBundle/Controller/Rest/ExportMappingController.php
+++ b/src/Webkul/PrestashopConnectorBundle/Controller/Rest/ExportMappingController.php
@@ -322,4 +322,13 @@ class ExportMappingController extends Controller
];
}
+
+ public function getChannels()
+ {
+ return [
+ 'Coucou' => 'coucou',
+ 'Test' => 'test',
+
+ ];
+ }
}
diff --git a/src/Webkul/PrestashopConnectorBundle/Entity/PrestashopExportMapping.php b/src/Webkul/PrestashopConnectorBundle/Entity/PrestashopExportMapping.php
index b218315..7010b8f 100644
--- a/src/Webkul/PrestashopConnectorBundle/Entity/PrestashopExportMapping.php
+++ b/src/Webkul/PrestashopConnectorBundle/Entity/PrestashopExportMapping.php
@@ -37,6 +37,10 @@ class PrestashopExportMapping
*/
private $entityType;
+ /**
+ * @var string
+ */
+ private $channel;
/**
* Get id
@@ -226,4 +230,24 @@ class PrestashopExportMapping
{
return $this->extras;
}
+
+ /**
+ * @return string
+ */
+ public function getChannel()
+ {
+ return $this->channel;
+ }
+
+ /**
+ * @param string $channel
+ *
+ * @return PrestashopExportMapping
+ */
+ public function setChannel($channel)
+ {
+ $this->channel = $channel;
+
+ return $this;
+ }
}
diff --git a/src/Webkul/PrestashopConnectorBundle/Resources/config/datagrid/prestashop_export_mapping.yml b/src/Webkul/PrestashopConnectorBundle/Resources/config/datagrid/prestashop_export_mapping.yml
index 33e1cb1..2ed5994 100644
--- a/src/Webkul/PrestashopConnectorBundle/Resources/config/datagrid/prestashop_export_mapping.yml
+++ b/src/Webkul/PrestashopConnectorBundle/Resources/config/datagrid/prestashop_export_mapping.yml
@@ -16,6 +16,7 @@ datagrid:
- wem.akeneoEntityName
- wem.prestashopEntityName
- wem.entityType
+ - wem.channel
from:
- { table: 'Webkul\PrestashopConnectorBundle\Entity\PrestashopExportMapping', alias: wem }
columns:
@@ -33,6 +34,8 @@ datagrid:
label: webkul_prestashop_connector.export_mapping.grid.export_mappings.columns.prestashop_entity_name
entityType:
label: webkul_prestashop_connector.export_mapping.grid.export_mappings.columns.entity_type
+ channel:
+ label: channel
properties:
id: ~
@@ -97,6 +100,13 @@ datagrid:
field_options:
multiple: true
choices: '@webkul_prestashop_connector.controller.rest.export_mapping->getTypes'
+ channel:
+ type: choice
+ data_name: wem.channel
+ options:
+ field_options:
+ multiple: false
+ choices: '@webkul_prestashop_connector.controller.rest.export_mapping->getChannels'
actions:
delete:
diff --git a/src/Webkul/PrestashopConnectorBundle/Resources/config/doctrine/PrestashopExportMapping.orm.yml b/src/Webkul/PrestashopConnectorBundle/Resources/config/doctrine/PrestashopExportMapping.orm.yml
index c028e34..8c16649 100644
--- a/src/Webkul/PrestashopConnectorBundle/Resources/config/doctrine/PrestashopExportMapping.orm.yml
+++ b/src/Webkul/PrestashopConnectorBundle/Resources/config/doctrine/PrestashopExportMapping.orm.yml
@@ -33,4 +33,8 @@ Webkul\PrestashopConnectorBundle\Entity\PrestashopExportMapping:
type: string
length: 255
nullable: true
+ channel:
+ type: string
+ length: 255
+ nullable: true
lifecycleCallbacks: { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment