3 namespace Drupal\draggableviews\Plugin\migrate\destination;
5 use Drupal\Core\Database\Database;
6 use Drupal\migrate\Entity\MigrationInterface;
7 use Drupal\migrate\Plugin\migrate\destination\DestinationBase;
8 use Drupal\migrate\Row;
11 * Defines destination plugin for Draggableviews.
13 * @MigrateDestination(
14 * id = "draggableviews"
17 class DraggableViews extends DestinationBase {
22 public function import(Row $row, array $old_destination_id_values = []) {
24 'view_name' => $row->getDestinationProperty('view_name'),
25 'view_display' => $row->getDestinationProperty('view_display'),
26 'args' => $row->getDestinationProperty('args'),
27 'entity_id' => $row->getDestinationProperty('entity_id'),
28 'weight' => $row->getDestinationProperty('weight'),
29 'parent' => $row->getDestinationProperty('parent'),
31 $result = Database::getConnection()->insert('draggableviews_structure')->fields($record)->execute();
38 public function getIds() {
49 public function fields(MigrationInterface $migration = NULL) {
51 'dvid' => $this->t('The primarty identifier'),
52 'view_name' => $this->t('The view name.'),
53 'view_display' => $this->t('The view display.'),
54 'args' => $this->t('The arguments.'),
55 'entity_id' => $this->t('The entity id.'),
56 'weight' => $this->t('The order weight.'),
57 'parent' => $this->t('The parent entity id.'),