You are here

public function PhoneNumberVerification::getPhoneVerificationByCode in SMS Framework 8

Same name and namespace in other branches
  1. 2.x src/Provider/PhoneNumberVerification.php \Drupal\sms\Provider\PhoneNumberVerification::getPhoneVerificationByCode()
  2. 2.1.x src/Provider/PhoneNumberVerification.php \Drupal\sms\Provider\PhoneNumberVerification::getPhoneVerificationByCode()

Checks if there is a phone number verification for a code.

Parameters

string $code: A string to check is a verification code.

Return value

\Drupal\sms\Entity\PhoneNumberVerificationInterface|false A phone number verification entity, or FALSE if $code is not a valid verification code.

Overrides PhoneNumberVerificationInterface::getPhoneVerificationByCode

File

src/Provider/PhoneNumberVerification.php, line 99

Class

PhoneNumberVerification
Phone number verification provider.

Namespace

Drupal\sms\Provider

Code

public function getPhoneVerificationByCode($code) {
  $entities = $this->phoneNumberVerificationStorage
    ->loadByProperties([
    'code' => $code,
  ]);
  return reset($entities);
}