You are here

public function SmsVerification::import in SMS Framework 2.1.x

Same name and namespace in other branches
  1. 8 src/Plugin/migrate/destination/SmsVerification.php \Drupal\sms\Plugin\migrate\destination\SmsVerification::import()
  2. 2.x src/Plugin/migrate/destination/SmsVerification.php \Drupal\sms\Plugin\migrate\destination\SmsVerification::import()

Throws

\Drupal\migrate\MigrateException When an entity cannot be looked up.

\Drupal\migrate\Exception\EntityValidationException When an entity validation hasn't been passed.

Overrides EntityContentBase::import

File

src/Plugin/migrate/destination/SmsVerification.php, line 82

Class

SmsVerification
Destination plugin for SMS phone number verifications.

Namespace

Drupal\sms\Plugin\migrate\destination

Code

public function import(Row $row, array $old_destination_id_values = []) {
  $return = parent::import($row, $old_destination_id_values);
  if ($return) {

    // After successful import of the verification data, the phone number
    // should be updated on the corresponding user entity.

    /** @var \Drupal\sms\Entity\PhoneNumberVerification $verification */
    $verification = $this->storage
      ->load(reset($return));
    $this
      ->setVerifiedValue($verification, $row
      ->getSourceProperty('delta'));
  }
  return $return;
}