class MigrateSource
Same name and namespace in other branches
- 11.x core/modules/migrate/src/Attribute/MigrateSource.php \Drupal\migrate\Attribute\MigrateSource
- 11.x core/modules/migrate/src/Annotation/MigrateSource.php \Drupal\migrate\Annotation\MigrateSource
- 10 core/modules/migrate/src/Annotation/MigrateSource.php \Drupal\migrate\Annotation\MigrateSource
- 8.9.x core/modules/migrate/src/Annotation/MigrateSource.php \Drupal\migrate\Annotation\MigrateSource
Defines a migration source plugin annotation object.
Plugin Namespace: Plugin\migrate\source
For a working example, check \Drupal\migrate\Plugin\migrate\source\EmptySource \Drupal\migrate_drupal\Plugin\migrate\source\UrlAlias
Hierarchy
- class \Drupal\Component\Annotation\Plugin implements \Drupal\Component\Annotation\AnnotationInterface
- class \Drupal\migrate\Annotation\MigrateSource implements \Drupal\migrate\Annotation\MultipleProviderAnnotationInterface extends \Drupal\Component\Annotation\Plugin
Expanded class hierarchy of MigrateSource
See also
\Drupal\migrate\Plugin\MigratePluginManager
\Drupal\migrate\Plugin\MigrateSourceInterface
\Drupal\migrate\Plugin\migrate\source\SourcePluginBase
\Drupal\migrate\Annotation\MigrateProcessPlugin
\Drupal\migrate\Annotation\MigrateDestination
Related topics
121 classes are annotated with MigrateSource
- Action in core/
modules/ system/ src/ Plugin/ migrate/ source/ Action.php - Drupal action source from database.
- AggregatorFeed in core/
modules/ aggregator/ src/ Plugin/ migrate/ source/ AggregatorFeed.php - Drupal 6/7 feed source from database.
- AggregatorItem in core/
modules/ aggregator/ src/ Plugin/ migrate/ source/ AggregatorItem.php - Drupal 6/7 aggregator item source from database.
- Block in core/
modules/ block/ src/ Plugin/ migrate/ source/ Block.php - Drupal 6/7 block source from database.
- BlockCustom in core/
modules/ block_content/ src/ Plugin/ migrate/ source/ d7/ BlockCustom.php - Drupal 7 custom block source from database.
File
-
core/
modules/ migrate/ src/ Annotation/ MigrateSource.php, line 27
Namespace
Drupal\migrate\AnnotationView source
class MigrateSource extends Plugin implements MultipleProviderAnnotationInterface {
/**
* A unique identifier for the process plugin.
*
* @var string
*/
public $id;
/**
* Whether requirements are met.
*
* @var bool
*/
public $requirements_met = TRUE;
/**
* Identifies the system providing the data the source plugin will read.
*
* The source plugin itself determines how the value is used. For example,
* Migrate Drupal's source plugins expect source_module to be the name of a
* module that must be installed and enabled in the source database.
*
* @see \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase::checkRequirements
*
* @var string
*/
public $source_module;
/**
* Specifies the minimum version of the source provider.
*
* This can be any type, and the source plugin itself determines how it is
* used. For example, Migrate Drupal's source plugins expect this to be an
* integer representing the minimum installed database schema version of the
* module specified by source_module.
*
* @var mixed
*/
public $minimum_version;
/**
* {@inheritdoc}
*/
public function getProvider() {
if (isset($this->definition['provider'])) {
return is_array($this->definition['provider']) ? reset($this->definition['provider']) : $this->definition['provider'];
}
return FALSE;
}
/**
* {@inheritdoc}
*/
public function getProviders() {
if (isset($this->definition['provider'])) {
// Ensure that we return an array even if
// \Drupal\Component\Annotation\AnnotationInterface::setProvider() has
// been called.
return (array) $this->definition['provider'];
}
return [];
}
/**
* {@inheritdoc}
*/
public function setProviders(array $providers) {
$this->definition['provider'] = $providers;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.