Same name in this branch
  1. 10 core/modules/book/src/Plugin/migrate/destination/Book.php \Drupal\book\Plugin\migrate\destination\Book
  2. 10 core/modules/book/src/Plugin/migrate/source/Book.php \Drupal\book\Plugin\migrate\source\Book
Same name and namespace in other branches
  1. 8.9.x core/modules/book/src/Plugin/migrate/destination/Book.php \Drupal\book\Plugin\migrate\destination\Book
  2. 9 core/modules/book/src/Plugin/migrate/destination/Book.php \Drupal\book\Plugin\migrate\destination\Book

Plugin annotation


@MigrateDestination(
  id = "book",
  provider = "book"
)

Hierarchy

Expanded class hierarchy of Book

13 string references to 'Book'
book.info.yml in core/modules/book/book.info.yml
core/modules/book/book.info.yml
BookController::adminOverview in core/modules/book/src/Controller/BookController.php
Returns an administrative overview of all books.
BookInstallTest::testBookInstallWithPreexistingContentType in core/modules/book/tests/src/Kernel/BookInstallTest.php
Tests Book install with pre-existing content type.
BookJavascriptTest::testBookOrdering in core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php
Tests re-ordering of books.
BookManager::addFormElements in core/modules/book/src/BookManager.php

... See full list

File

core/modules/book/src/Plugin/migrate/destination/Book.php, line 15

Namespace

Drupal\book\Plugin\migrate\destination
View source
class Book extends EntityContentBase {

  /**
   * {@inheritdoc}
   */
  protected static function getEntityTypeId($plugin_id) {
    return 'node';
  }

  /**
   * {@inheritdoc}
   */
  protected function updateEntity(EntityInterface $entity, Row $row) {
    if ($entity->book) {
      $book = $row
        ->getDestinationProperty('book');
      foreach ($book as $key => $value) {
        $entity->book[$key] = $value;
      }
    }
    else {
      $entity->book = $row
        ->getDestinationProperty('book');
    }
    return parent::updateEntity($entity, $row);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Book::getEntityTypeId protected static function
Book::updateEntity protected function Updates an entity with the new values from row. Overrides EntityContentBase::updateEntity
EntityContentBase::$accountSwitcher protected property The account switcher service.
EntityContentBase::$fieldTypeManager protected property Field type plugin manager.
EntityContentBase::create public static function 2
EntityContentBase::getHighestId public function Returns the highest ID tracked by the implementing plugin. Overrides HighestIdInterface::getHighestId 2
EntityContentBase::getIds public function 2
EntityContentBase::import public function 2
EntityContentBase::isEntityValidationRequired public function Returns a state of whether an entity needs to be validated before saving. Overrides MigrateValidatableEntityInterface::isEntityValidationRequired
EntityContentBase::isTranslationDestination public function
EntityContentBase::processStubRow protected function 3
EntityContentBase::rollback public function 1
EntityContentBase::save protected function Saves the entity. 3
EntityContentBase::validateEntity public function Validates the entity. Overrides MigrateValidatableEntityInterface::validateEntity
EntityContentBase::__construct public function Constructs a content entity. 3