popsu_migrate: D7ParagrapheTextsProgramme D7NodeProgramme cleaned

This commit is contained in:
Bachir Soussi Chiadmi 2021-04-16 10:56:35 +02:00
parent e7be345a30
commit 65b11b15e4
2 changed files with 2 additions and 26 deletions

View File

@ -3,19 +3,10 @@
namespace Drupal\popsu_migrate\Plugin\migrate\source;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
use Drupal\Core\Database\Query\SelectInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandler;
use Drupal\Core\State\StateInterface;
use Drupal\migrate\Plugin\MigrationInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drush\Drush;
use Drupal\popsu_migrate\Plugin\migrate\source\D7Programme;
// use Drupal\popsu_migrate\Plugin\migrate\source\D7Programme;
/**
* Drupal 7 node source from database.

View File

@ -3,19 +3,10 @@
namespace Drupal\popsu_migrate\Plugin\migrate\source;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
use Drupal\Core\Database\Query\SelectInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandler;
use Drupal\Core\State\StateInterface;
use Drupal\migrate\Plugin\MigrationInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drush\Drush;
use Drupal\popsu_migrate\Plugin\migrate\source\D7Programme;
// use Drupal\popsu_migrate\Plugin\migrate\source\D7Programme;
/**
* Drupal 7 node source from database.
@ -34,14 +25,9 @@ class D7PargrapheTextsProgramme extends D7Programme {
$nid = $row->getSourceProperty('nid');
$vid = $row->getSourceProperty('vid');
$type = $row->getSourceProperty('type');
// $title = $row->getSourceProperty('title');
// drush_print('-- '.$nid."\t".$title);
// Get Field API field values.
foreach ($this->getFields('node', $type) as $field_name => $field) {
// Ensure we're using the right language if the entity and the field are
// translatable.
// $field_language = $entity_translatable && $field['translatable'] ? $language : NULL;
$row->setSourceProperty($field_name, $this->getFieldValues('node', $field_name, $nid, $vid, NULL));
}
@ -50,7 +36,6 @@ class D7PargrapheTextsProgramme extends D7Programme {
$row->setSourceProperty('text', $text[0]['value']);
$row->setSourceProperty('text_summary', $text[0]['summary']);
return parent::prepareRow($row);
}