function IdConflictForm::formatConflicts

Same name in other branches
  1. 9 core/modules/migrate_drupal_ui/src/Form/IdConflictForm.php \Drupal\migrate_drupal_ui\Form\IdConflictForm::formatConflicts()
  2. 8.9.x core/modules/migrate_drupal_ui/src/Form/IdConflictForm.php \Drupal\migrate_drupal_ui\Form\IdConflictForm::formatConflicts()
  3. 10 core/modules/migrate_drupal_ui/src/Form/IdConflictForm.php \Drupal\migrate_drupal_ui\Form\IdConflictForm::formatConflicts()

Formats a set of failing audit results as strings.

Each string is the label of the destination plugin of the migration that failed the audit, keyed by the destination plugin ID in order to prevent duplication.

Parameters

\Drupal\migrate\Audit\AuditResult[] $conflicts: The failing audit results.

Return value

string[] The formatted audit results.

2 calls to IdConflictForm::formatConflicts()
IdConflictForm::conflictsForm in core/modules/migrate_drupal_ui/src/Form/IdConflictForm.php
Build the markup for conflict warnings.
IdConflictForm::i18nWarningForm in core/modules/migrate_drupal_ui/src/Form/IdConflictForm.php
Build the markup for i18n warnings.

File

core/modules/migrate_drupal_ui/src/Form/IdConflictForm.php, line 121

Class

IdConflictForm
Migrate Upgrade Id Conflict form.

Namespace

Drupal\migrate_drupal_ui\Form

Code

protected function formatConflicts(array $conflicts) {
    $items = [];
    foreach ($conflicts as $conflict) {
        $definition = $conflict->getMigration()
            ->getDestinationPlugin()
            ->getPluginDefinition();
        $id = $definition['id'];
        $items[$id] = $definition['label'];
    }
    sort($items, SORT_STRING);
    return array_unique($items);
}

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