Unverified Commit 490eceaf authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3196177 by Matroskeen, anmolgoyal74, quietone: Add documentation for variable source plugins

parent 1d146204
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -13,10 +13,14 @@
 * Depending on the configuration, this returns zero or a single row and as such
 * is not a good example for any normal source class returning multiple rows.
 *
 * The configuration may contain two lists of variable names, variables and
 * variables_no_row_if_missing. If any of the variables listed in
 * variables_no_row_if_missing is missing in the source, then the source will
 * return zero rows.
 * Available configuration keys (one of which must be defined):
 * - variables: (optional) The list of variables to retrieve from the source
 *   database. Specified variables are retrieved in a single row.
 * - variables_no_row_if_missing: (optional) The list of variables to retrieve
 *   from the source database. If any of the variables listed here are missing
 *   in the source, then the source will return zero rows.
 *
 * Examples:
 *
 * With this configuration, the source will return one row even when the
 * "filter_fallback_format" variable isn't available:
@@ -66,6 +70,10 @@
 *     - book_allowed_types
 * @endcode
 *
 * For additional configuration keys, refer to the parent classes:
 * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
 * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
 *
 * @MigrateSource(
 *   id = "variable",
 *   source_module = "system",
+21 −0
Original line number Diff line number Diff line
@@ -10,6 +10,27 @@
 * Unlike the variable source plugin, this one returns one row per
 * variable.
 *
 * Available configuration keys:
 * - variables: (required) The list of variables to retrieve from the source
 *   database. Each variable is retrieved in a separate row.
 *
 * Example:
 *
 * @code
 * plugin: variable_multirow
 * variables:
 *   - date_format_long
 *   - date_format_medium
 *   - date_format_short
 * @endcode
 *
 * In this example the specified variables are retrieved from the source
 * database one row per variable.
 *
 * For additional configuration keys, refer to the parent classes:
 * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
 * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
 *
 * @MigrateSource(
 *   id = "variable_multirow",
 *   source_module = "system",
+18 −0
Original line number Diff line number Diff line
@@ -11,6 +11,24 @@
/**
 * Drupal i18n_variable source from database.
 *
 * Available configuration keys:
 * - variables: (required) The list of variable translations to retrieve from
 *   the source database. All translations are retrieved in a single row.
 *
 * Examples:
 *
 * @code
 * plugin: d6_variable_translation
 * variables:
 *   - site_offline_message
 * @endcode
 * In this example the translations for site_offline_message variable are
 * retrieved from the source database.
 *
 * For additional configuration keys, refer to the parent classes:
 * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
 * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
 *
 * @MigrateSource(
 *   id = "d6_variable_translation",
 *   source_module = "i18n",
+19 −0
Original line number Diff line number Diff line
@@ -10,6 +10,25 @@
/**
 * Gets Drupal variable_store source from database.
 *
 * Available configuration keys:
 * - variables: (required) The list of variable translations to retrieve from
 *   the source database. All translations are retrieved in a single row.
 *
 * Example:
 *
 * @code
 * plugin: d7_variable_translation
 * variables:
 *   - site_name
 *   - site_slogan
 * @endcode
 * In this example the translations for site_name and site_slogan variables are
 * retrieved from the source database.
 *
 * For additional configuration keys, refer to the parent classes:
 * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
 * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
 *
 * @MigrateSource(
 *   id = "d7_variable_translation",
 *   source_module = "i18n_variable",