1<?php 2 3namespace Drupal\migrate\Plugin\migrate\id_map; 4 5use Drupal\Core\Plugin\PluginBase; 6use Drupal\migrate\MigrateMessageInterface; 7use Drupal\migrate\Plugin\MigrateIdMapInterface; 8use Drupal\migrate\Plugin\MigrationInterface; 9use Drupal\migrate\Row; 10 11/** 12 * Defines the null ID map implementation. 13 * 14 * This serves as a dummy in order to not store anything. 15 * 16 * @PluginID("null") 17 */ 18class NullIdMap extends PluginBase implements MigrateIdMapInterface { 19 20 /** 21 * {@inheritdoc} 22 */ 23 public function setMessage(MigrateMessageInterface $message) { 24 // Do nothing. 25 } 26 27 /** 28 * {@inheritdoc} 29 */ 30 public function getRowBySource(array $source_id_values) { 31 return []; 32 } 33 34 /** 35 * {@inheritdoc} 36 */ 37 public function getRowByDestination(array $destination_id_values) { 38 return []; 39 } 40 41 /** 42 * {@inheritdoc} 43 */ 44 public function getRowsNeedingUpdate($count) { 45 return 0; 46 } 47 48 /** 49 * {@inheritdoc} 50 */ 51 public function lookupSourceId(array $destination_id_values) { 52 return []; 53 } 54 55 /** 56 * {@inheritdoc} 57 */ 58 public function lookupDestinationIds(array $source_id_values) { 59 return []; 60 } 61 62 /** 63 * {@inheritdoc} 64 */ 65 public function saveIdMapping(Row $row, array $destination_id_values, $source_row_status = MigrateIdMapInterface::STATUS_IMPORTED, $rollback_action = MigrateIdMapInterface::ROLLBACK_DELETE) { 66 // Do nothing. 67 } 68 69 /** 70 * {@inheritdoc} 71 */ 72 public function saveMessage(array $source_id_values, $message, $level = MigrationInterface::MESSAGE_ERROR) { 73 // Do nothing. 74 } 75 76 /** 77 * {@inheritdoc} 78 */ 79 public function getMessages(array $source_id_values = [], $level = NULL) { 80 return new \ArrayIterator([]); 81 } 82 83 /** 84 * {@inheritdoc} 85 */ 86 public function prepareUpdate() { 87 // Do nothing. 88 } 89 90 /** 91 * {@inheritdoc} 92 */ 93 public function processedCount() { 94 return 0; 95 } 96 97 /** 98 * {@inheritdoc} 99 */ 100 public function importedCount() { 101 return 0; 102 } 103 104 /** 105 * {@inheritdoc} 106 */ 107 public function updateCount() { 108 return 0; 109 } 110 111 /** 112 * {@inheritdoc} 113 */ 114 public function errorCount() { 115 return 0; 116 } 117 118 /** 119 * {@inheritdoc} 120 */ 121 public function messageCount() { 122 return 0; 123 } 124 125 /** 126 * {@inheritdoc} 127 */ 128 public function delete(array $source_id_values, $messages_only = FALSE) { 129 // Do nothing. 130 } 131 132 /** 133 * {@inheritdoc} 134 */ 135 public function deleteDestination(array $destination_id_values) { 136 // Do nothing. 137 } 138 139 /** 140 * {@inheritdoc} 141 */ 142 public function setUpdate(array $source_id_values) { 143 // Do nothing. 144 } 145 146 /** 147 * {@inheritdoc} 148 */ 149 public function clearMessages() { 150 // Do nothing. 151 } 152 153 /** 154 * {@inheritdoc} 155 */ 156 public function destroy() { 157 // Do nothing. 158 } 159 160 /** 161 * {@inheritdoc} 162 */ 163 public function currentDestination() { 164 return NULL; 165 } 166 167 /** 168 * {@inheritdoc} 169 */ 170 public function currentSource() { 171 return NULL; 172 } 173 174 /** 175 * {@inheritdoc} 176 */ 177 public function getQualifiedMapTableName() { 178 return ''; 179 } 180 181 /** 182 * {@inheritdoc} 183 */ 184 public function rewind() { 185 return NULL; 186 } 187 188 /** 189 * {@inheritdoc} 190 */ 191 public function current() { 192 return NULL; 193 } 194 195 /** 196 * {@inheritdoc} 197 */ 198 public function key() { 199 return ''; 200 } 201 202 /** 203 * {@inheritdoc} 204 */ 205 public function next() { 206 return NULL; 207 } 208 209 /** 210 * {@inheritdoc} 211 */ 212 public function valid() { 213 return FALSE; 214 } 215 216} 217