started custom migration module migrate_leshed
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\migrate_leshed\Plugin\migrate\source;
|
||||
|
||||
use Drupal\migrate\Attribute\MigrateSource;
|
||||
use Drupal\migrate_plus\Plugin\migrate\source\Url;
|
||||
use Drupal\migrate\Row;
|
||||
|
||||
/**
|
||||
* @MigrateSource(
|
||||
* id = "projet_node"
|
||||
* )
|
||||
*/
|
||||
#[MigrateSource(id: 'projet_node')]
|
||||
final class ProjetNode extends Url {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function fields(): array {
|
||||
// theese are source fields
|
||||
return [
|
||||
'id' => $this->t('Project ID'),
|
||||
'title' => $this->t('Project Title'),
|
||||
'date_start' => $this->t('Project date start'),
|
||||
'date_end' => $this->t('Project date end')
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getIds(): array {
|
||||
return [
|
||||
'id' => [
|
||||
'type' => 'string',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function prepareRow(Row $row) {
|
||||
// $nid = $row->getSourceProperty('entity_id');
|
||||
// $vid = $row->getSourceProperty('revision_id');
|
||||
// $type = $row->getSourceProperty('type');
|
||||
// $language = $row->getSourceProperty('language');
|
||||
// $title = $row->getSourceProperty('title');
|
||||
// // drush_print('-- '.$nid."\t".$title."\t".$language);
|
||||
|
||||
|
||||
|
||||
return parent::prepareRow($row);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user