3 namespace Drupal\migrate\Annotation;
5 use Drupal\Component\Annotation\Plugin;
8 * Defines a migration source plugin annotation object.
10 * Plugin Namespace: Plugin\migrate\source
12 * For a working example, check
13 * \Drupal\migrate\Plugin\migrate\source\EmptySource
14 * \Drupal\migrate_drupal\Plugin\migrate\source\UrlAlias
16 * @see \Drupal\migrate\Plugin\MigratePluginManager
17 * @see \Drupal\migrate\Plugin\MigrateSourceInterface
18 * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
19 * @see \Drupal\migrate\Annotation\MigrateProcessPlugin
20 * @see \Drupal\migrate\Annotation\MigrateDestination
27 class MigrateSource extends Plugin implements MultipleProviderAnnotationInterface {
30 * A unique identifier for the process plugin.
37 * Whether requirements are met.
41 public $requirements_met = TRUE;
44 * Identifies the system providing the data the source plugin will read.
46 * This can be any type, and the source plugin itself determines how the value
47 * is used. For example, Migrate Drupal's source plugins expect
48 * source_provider to be the name of a module that must be installed and
49 * enabled in the source database.
51 * @see \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase::checkRequirements
55 public $source_provider;
58 * Specifies the minimum version of the source provider.
60 * This can be any type, and the source plugin itself determines how it is
61 * used. For example, Migrate Drupal's source plugins expect this to be an
62 * integer representing the minimum installed database schema version of the
63 * module specified by source_provider.
67 public $minimum_version;
72 public function getProvider() {
73 if (isset($this->definition['provider'])) {
74 return is_array($this->definition['provider']) ? reset($this->definition['provider']) : $this->definition['provider'];
82 public function getProviders() {
83 if (isset($this->definition['provider'])) {
84 // Ensure that we return an array even if
85 // \Drupal\Component\Annotation\AnnotationInterface::setProvider() has
87 return (array) $this->definition['provider'];
95 public function setProviders(array $providers) {
96 $this->definition['provider'] = $providers;