MigrateSkipAllRowsTestHooks.php

Namespace

Drupal\migrate_skip_all_rows_test\Hook

File

core/modules/migrate/tests/modules/migrate_skip_all_rows_test/src/Hook/MigrateSkipAllRowsTestHooks.php

View source
<?php

declare (strict_types=1);
namespace Drupal\migrate_skip_all_rows_test\Hook;

use Drupal\migrate\MigrateSkipRowException;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Plugin\MigrateSourceInterface;
use Drupal\migrate\Row;
use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for migrate_skip_all_rows_test.
 */
class MigrateSkipAllRowsTestHooks {
    
    /**
     * Implements hook_migrate_prepare_row().
     */
    public function migratePrepareRow(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) {
        if (\Drupal::state()->get('migrate_skip_all_rows_test_migrate_prepare_row')) {
            throw new MigrateSkipRowException();
        }
    }

}

Classes

Title Deprecated Summary
MigrateSkipAllRowsTestHooks Hook implementations for migrate_skip_all_rows_test.

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