function DestinationBase::setRollbackAction

Same name in other branches
  1. 9 core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php \Drupal\migrate\Plugin\migrate\destination\DestinationBase::setRollbackAction()
  2. 8.9.x core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php \Drupal\migrate\Plugin\migrate\destination\DestinationBase::setRollbackAction()
  3. 11.x core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php \Drupal\migrate\Plugin\migrate\destination\DestinationBase::setRollbackAction()

For a destination item being updated, set the appropriate rollback action.

Parameters

array $id_map: The map row data for the item.

int $update_action: The rollback action to take if we are updating an existing item.

3 calls to DestinationBase::setRollbackAction()
EntityConfigBase::updateEntity in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
Updates an entity with the contents of a row.
EntityContentBase::updateEntity in core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
Updates an entity with the new values from row.
EntityContentComplete::updateEntity in core/modules/migrate/src/Plugin/migrate/destination/EntityContentComplete.php
Updates an entity with the new values from row.

File

core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php, line 107

Class

DestinationBase
Base class for migrate destination classes.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

protected function setRollbackAction(array $id_map, $update_action = MigrateIdMapInterface::ROLLBACK_PRESERVE) {
    // If the entity we're updating was previously migrated by us, preserve the
    // existing rollback action.
    if (isset($id_map['sourceid1'])) {
        $this->rollbackAction = $id_map['rollback_action'];
    }
    else {
        $this->rollbackAction = $update_action;
    }
}

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