function EntitySearchPage::updateEntity

Same name in other branches
  1. 9 core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php \Drupal\search\Plugin\migrate\destination\EntitySearchPage::updateEntity()
  2. 10 core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php \Drupal\search\Plugin\migrate\destination\EntitySearchPage::updateEntity()
  3. 11.x 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'));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.