Version 1
[yaffs-website] / web / core / modules / ban / src / Plugin / migrate / source / d7 / BlockedIps.php
diff --git a/web/core/modules/ban/src/Plugin/migrate/source/d7/BlockedIps.php b/web/core/modules/ban/src/Plugin/migrate/source/d7/BlockedIps.php
new file mode 100644 (file)
index 0000000..fc4d877
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\ban\Plugin\migrate\source\d7;
+
+use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
+
+/**
+ * Drupal 7 blocked IPs from database.
+ *
+ * @MigrateSource(
+ *   id = "d7_blocked_ips",
+ *   source_provider = "system"
+ * )
+ */
+class BlockedIps extends DrupalSqlBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function query() {
+    return $this->select('blocked_ips', 'bi')->fields('bi', ['ip']);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function fields() {
+    return [
+      'ip' => $this->t('The blocked IP address.'),
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getIds() {
+    return ['ip' => ['type' => 'string']];
+  }
+
+}