You are here

protected function EntitySearchPage::updateEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php \Drupal\search\Plugin\migrate\destination\EntitySearchPage::updateEntity()
  2. 9 core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php \Drupal\search\Plugin\migrate\destination\EntitySearchPage::updateEntity()

Updates the entity with the contents of a row.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The search page entity.

\Drupal\migrate\Row $row: The row object to update from.

Overrides EntityConfigBase::updateEntity

File

core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php, line 100

Class

EntitySearchPage
Migrate destination for search page.

Namespace

Drupal\search\Plugin\migrate\destination

Code

protected function updateEntity(EntityInterface $entity, Row $row) {
  parent::updateEntity($entity, $row);
  $entity
    ->setPlugin($row
    ->getDestinationProperty('plugin'));

  // The user_search plugin does not have a setConfiguration() method.
  $plugin = $entity
    ->getPlugin();
  if ($plugin instanceof ConfigurableSearchPluginBase) {
    $plugin
      ->setConfiguration($row
      ->getDestinationProperty('configuration'));
  }
}