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

Breadcrumb

  1. Drupal Core 11.1.x

SearchConfigurationRankings.php

Namespace

Drupal\search\Plugin\migrate\process

File

core/modules/search/src/Plugin/migrate/process/SearchConfigurationRankings.php

View source
<?php

namespace Drupal\search\Plugin\migrate\process;

use Drupal\migrate\Attribute\MigrateProcess;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Row;

/**
 * Generate configuration rankings.
 */
class SearchConfigurationRankings extends ProcessPluginBase {
    
    /**
     * {@inheritdoc}
     *
     * Generate the configuration rankings.
     */
    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;
    }

}

Classes

Title Deprecated Summary
SearchConfigurationRankings Generate configuration rankings.

API Navigation

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