From 9e973308c79226f836e18511d3a7f811c0a35dd1 Mon Sep 17 00:00:00 2001
From: jedihe <jedihe@350711.no-reply.drupal.org>
Date: Fri, 3 Jan 2020 08:30:16 -0600
Subject: [PATCH] Issue #2981906 by xurizaemon, jedihe: Document table
 destination plugin

---
 src/Plugin/migrate/destination/Table.php | 47 ++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/src/Plugin/migrate/destination/Table.php b/src/Plugin/migrate/destination/Table.php
index 84a619a0..00d24159 100755
--- a/src/Plugin/migrate/destination/Table.php
+++ b/src/Plugin/migrate/destination/Table.php
@@ -19,6 +19,53 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  *
  * Use this plugin for a table not registered with Drupal Schema API.
  *
+ * Examples:
+ *
+ * @code
+ *   destination:
+ *     plugin: table
+ *     # Key for the database connection to use for inserting records.
+ *     database_key: roads_db
+ *     # DB table for storage.
+ *     table_name: roads
+ *     # Maximum number of rows to insert in one query.
+ *     batch_size: 3
+ *     # Fields used by migrate to identify table rows uniquely. At least one
+ *     # field is required.
+ *     id_fields:
+ *       name:
+ *         type: string
+ *       suburb:
+ *         type: string
+ *       ward:
+ *         type: string
+ *     # Mapping of column names to values set in migrate process.
+ *     fields:
+ *       name: name
+ *       owner: owner
+ *       suburb: suburb
+ *       ward: ward
+ *       type: type
+ * @endcode
+ *
+ * For numeric id fields, migrate can generate the values on-the-fly, by
+ * enabling use_auto_increment; in such case, the id field may be ommitted from
+ * the 'fields' section:
+ *
+ * @code
+ *   destination:
+ *     plugin: table
+ *     # ...
+ *     id_fields:
+ *       my_id_field:
+ *         type: integer
+ *         use_auto_increment: true
+ *     # ...
+ *     fields:
+ *       non_my_id_field_1: non_my_id_field_1
+ *       non_my_id_field_2: non_my_id_field_2
+ * @endcode
+ *
  * @MigrateDestination(
  *   id = "table"
  * )
-- 
GitLab