started custom migration module migrate_leshed

This commit is contained in:
2026-07-11 15:20:42 +02:00
parent a1201aff21
commit ec5b13be3c
16 changed files with 3287 additions and 244 deletions
@@ -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);
}
}