Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SearchConfigurationRankings.php

function SearchConfigurationRankings::transform

Generate the configuration rankings.

Overrides ProcessPluginBase::transform

File

core/modules/search/src/Plugin/migrate/process/SearchConfigurationRankings.php, line 21

Class

SearchConfigurationRankings
Generate configuration rankings.

Namespace

Drupal\search\Plugin\migrate\process

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    $return = NULL;
    foreach ($row->getSource() as $name => $rank) {
        if (str_starts_with($name, 'node_rank_') && is_numeric($rank)) {
            $return[substr($name, 10)] = $rank;
        }
    }
    return $return;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal