From d53d8cf727ea1c7bec6f1855cadda6f2802d7b3e Mon Sep 17 00:00:00 2001 From: webchick <webchick@24967.no-reply.drupal.org> Date: Mon, 7 Apr 2014 11:50:29 -0700 Subject: [PATCH] Issue #2233029 by benjy: Add a Book destination to the Migrate API. --- .../Plugin/migrate/destination/Book.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/Book.php diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/Book.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/Book.php new file mode 100644 index 000000000000..f6ff9325a54e --- /dev/null +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/Book.php @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains \Drupal\migrate\Plugin\migrate\destination\Book. + */ + +namespace Drupal\migrate\Plugin\migrate\destination; + +use Drupal\Core\Entity\EntityInterface; +use Drupal\migrate\Row; + +/** + * @MigrateDestination( + * id = "book", + * provider = "book" + * ) + */ +class Book extends EntityContentBase { + + /** + * {@inheritdoc} + */ + protected static function getEntityTypeId($plugin_id) { + return 'node'; + } + + /** + * {@inheritdoc} + */ + protected function updateEntity(EntityInterface $entity, Row $row) { + $entity->book = $row->getDestinationProperty('book'); + } + +} -- GitLab