From af7d608349a818d0af5114ddff8a65222f96cb0c Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy <gabor@hojtsy.hu> Date: Tue, 11 Apr 2017 22:06:21 +0200 Subject: [PATCH] Issue #2862672 by Jo Fitzgerald, quietone, heddn: Add documentation to EmbeddedDataSource source plugin --- .../migrate/source/EmbeddedDataSource.php | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php b/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php index 05be56da8ba4..0bb35f3e24bb 100644 --- a/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php +++ b/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php @@ -1,10 +1,41 @@ <?php namespace Drupal\migrate\Plugin\migrate\source; + use Drupal\migrate\Plugin\MigrationInterface; /** - * Source which takes its data directly from the plugin config. + * Allows source data to be defined in the configuration of the source plugin. + * + * The embedded_data source plugin is used to inject source data from the plugin + * configuration. One use case is when some small amount of fixed data is + * imported, so that it can be referenced by other migrations. Another use case + * is testing. + * + * Available configuration keys + * - data_rows: The source data array. + * - ids: The unique ID field of the data. + * + * Examples: + * + * @code + * source: + * plugin: embedded_data + * data_rows: + * - + * channel_machine_name: music + * channel_description: Music + * - + * channel_machine_name: movies + * channel_description: Movies + * ids: + * channel_machine_name: + * type: string + * @endcode + * + * This example migrates a channel vocabulary. + * + * @see \Drupal\migrate\Plugin\MigrateSourceInterface * * @MigrateSource( * id = "embedded_data" -- GitLab