class RdfMapping
Same name in this branch
- 9 core/modules/rdf/src/Entity/RdfMapping.php \Drupal\rdf\Entity\RdfMapping
Same name and namespace in other branches
- 8.9.x core/modules/rdf/src/Entity/RdfMapping.php \Drupal\rdf\Entity\RdfMapping
- 8.9.x core/modules/rdf/src/Plugin/migrate/source/d7/RdfMapping.php \Drupal\rdf\Plugin\migrate\source\d7\RdfMapping
Drupal 7 rdf source from database.
For available configuration keys, refer to the parent classes.
Plugin annotation
@MigrateSource(
id = "d7_rdf_mapping",
source_module = "rdf"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\migrate\Plugin\migrate\source\SourcePluginBase implements \Drupal\migrate\Plugin\MigrateSourceInterface, \Drupal\migrate\Event\RollbackAwareInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\migrate\Plugin\migrate\source\SqlBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\migrate\Plugin\RequirementsInterface extends \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
- class \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase implements \Drupal\Component\Plugin\DependentPluginInterface uses \Drupal\Core\Entity\DependencyTrait extends \Drupal\migrate\Plugin\migrate\source\SqlBase
- class \Drupal\rdf\Plugin\migrate\source\d7\RdfMapping extends \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase
- class \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase implements \Drupal\Component\Plugin\DependentPluginInterface uses \Drupal\Core\Entity\DependencyTrait extends \Drupal\migrate\Plugin\migrate\source\SqlBase
- class \Drupal\migrate\Plugin\migrate\source\SqlBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\migrate\Plugin\RequirementsInterface extends \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
- class \Drupal\migrate\Plugin\migrate\source\SourcePluginBase implements \Drupal\migrate\Plugin\MigrateSourceInterface, \Drupal\migrate\Event\RollbackAwareInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of RdfMapping
See also
\Drupal\migrate\Plugin\migrate\source\SqlBase
\Drupal\migrate\Plugin\migrate\source\SourcePluginBase
File
-
core/
modules/ rdf/ src/ Plugin/ migrate/ source/ d7/ RdfMapping.php, line 23
Namespace
Drupal\rdf\Plugin\migrate\source\d7View source
class RdfMapping extends DrupalSqlBase {
/**
* {@inheritdoc}
*/
public function query() {
return $this->select('rdf_mapping', 'r')
->fields('r');
}
/**
* {@inheritdoc}
*/
public function prepareRow(Row $row) {
$field_mappings = [];
foreach (unserialize($row->getSourceProperty('mapping')) as $field => $mapping) {
if ($field === 'rdftype') {
$row->setSourceProperty('types', $mapping);
}
else {
$field_mappings[$field] = $mapping;
}
}
$row->setSourceProperty('fieldMappings', $field_mappings);
return parent::prepareRow($row);
}
/**
* {@inheritdoc}
*/
public function fields() {
return [
'type' => $this->t('The name of the entity type a mapping applies to (node, user, comment, etc.)'),
'bundle' => $this->t('The name of the bundle a mapping applies to.'),
'mapping' => $this->t('The serialized mapping of the bundle type and fields to RDF terms.'),
'types' => $this->t('RDF types.'),
'fieldMappings' => $this->t('RDF field mappings.'),
];
}
/**
* {@inheritdoc}
*/
public function getIds() {
return [
'type' => [
'type' => 'string',
],
'bundle' => [
'type' => 'string',
],
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.