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. 8.9.x 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()

Overrides EntityConfigBase::updateEntity

File

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

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'));
    }
    return $entity;
}

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