protected function SmsVerification::unsetVerifiedValue in SMS Framework 2.1.x
Same name and namespace in other branches
- 8 src/Plugin/migrate/destination/SmsVerification.php \Drupal\sms\Plugin\migrate\destination\SmsVerification::unsetVerifiedValue()
- 2.x src/Plugin/migrate/destination/SmsVerification.php \Drupal\sms\Plugin\migrate\destination\SmsVerification::unsetVerifiedValue()
Unsets the verified value for the user entity.
Parameters
\Drupal\sms\Entity\PhoneNumberVerificationInterface $verification: The phone number verification for a given user entity.
1 call to SmsVerification::unsetVerifiedValue()
- SmsVerification::rollback in src/
Plugin/ migrate/ destination/ SmsVerification.php - Delete the specified destination object from the target Drupal.
File
- src/
Plugin/ migrate/ destination/ SmsVerification.php, line 133
Class
- SmsVerification
- Destination plugin for SMS phone number verifications.
Namespace
Drupal\sms\Plugin\migrate\destinationCode
protected function unsetVerifiedValue(EntityPhoneNumberVerificationInterface $verification) {
$user_entity = $verification
->getEntity();
$phone_number_settings = $this->phoneNumberVerificationService
->getPhoneNumberSettingsForEntity($user_entity);
if ($user_entity && $phone_number_settings) {
$phone_field_name = $phone_number_settings
->getFieldName('phone_number');
$user_entity->{$phone_field_name} = '';
$user_entity
->save();
}
}