getSaveToMap example

$this->processPipeline($row$destination_property_name$plugins, NULL);
          }
          $save = TRUE;
        }
        catch (MigrateException $e) {
          $this->getIdMap()->saveIdMapping($row[]$e->getStatus());
          $msg = sprintf("%s:%s:%s", $this->migration->getPluginId()$destination_property_name$e->getMessage());
          $this->saveMessage($msg$e->getLevel());
          $save = FALSE;
        }
        catch (MigrateSkipRowException $e) {
          if ($e->getSaveToMap()) {
            $id_map->saveIdMapping($row[], MigrateIdMapInterface::STATUS_IGNORED);
          }
          if ($message = trim($e->getMessage())) {
            $msg = sprintf("%s:%s: %s", $this->migration->getPluginId()$destination_property_name$message);
            $this->saveMessage($msg, MigrationInterface::MESSAGE_INFORMATIONAL);
          }
          $save = FALSE;
        }

        if ($save) {
          try {
            
public function prepareRow(Row $row) {
    $result = TRUE;
    try {
      $result_hook = $this->getModuleHandler()->invokeAll('migrate_prepare_row', [$row$this$this->migration]);
      $result_named_hook = $this->getModuleHandler()->invokeAll('migrate_' . $this->migration->id() . '_prepare_row', [$row$this$this->migration]);
      // We will skip if any hook returned FALSE.       $skip = ($result_hook && in_array(FALSE, $result_hook)) || ($result_named_hook && in_array(FALSE, $result_named_hook));
      $save_to_map = TRUE;
    }
    catch (MigrateSkipRowException $e) {
      $skip = TRUE;
      $save_to_map = $e->getSaveToMap();
      if ($message = trim($e->getMessage())) {
        $this->idMap->saveMessage($row->getSourceIdValues()$message, MigrationInterface::MESSAGE_INFORMATIONAL);
      }
    }

    // We're explicitly skipping this row - keep track in the map table.     if ($skip) {
      // Make sure we replace any previous messages for this item with any       // new ones.       if ($save_to_map) {
        $this->idMap->saveIdMapping($row[], MigrateIdMapInterface::STATUS_IGNORED);
        
Home | Imprint | This part of the site doesn't use cookies.