Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
......@@ -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",
......
......@@ -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",
......
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment