interface PhoneNumberVerificationInterface in SMS Framework 8
Same name in this branch
- 8 src/Provider/PhoneNumberVerificationInterface.php \Drupal\sms\Provider\PhoneNumberVerificationInterface
- 8 src/Entity/PhoneNumberVerificationInterface.php \Drupal\sms\Entity\PhoneNumberVerificationInterface
Same name and namespace in other branches
- 2.x src/Provider/PhoneNumberVerificationInterface.php \Drupal\sms\Provider\PhoneNumberVerificationInterface
- 2.1.x src/Provider/PhoneNumberVerificationInterface.php \Drupal\sms\Provider\PhoneNumberVerificationInterface
Interface for phone number provider.
Hierarchy
- interface \Drupal\sms\Provider\PhoneNumberVerificationInterface
Expanded class hierarchy of PhoneNumberVerificationInterface
All classes that implement PhoneNumberVerificationInterface
7 files declare their use of PhoneNumberVerificationInterface
- AccountRegistration.php in modules/
sms_user/ src/ AccountRegistration.php - AdminSettingsForm.php in modules/
sms_user/ src/ Form/ AdminSettingsForm.php - PhoneNumberSettingsListBuilder.php in src/
Lists/ PhoneNumberSettingsListBuilder.php - SmsEntityPhoneNumberProcessor.php in src/
EventSubscriber/ SmsEntityPhoneNumberProcessor.php - SmsUserMenuLink.php in modules/
sms_user/ src/ Plugin/ Derivative/ SmsUserMenuLink.php
File
- src/
Provider/ PhoneNumberVerificationInterface.php, line 10
Namespace
Drupal\sms\ProviderView source
interface PhoneNumberVerificationInterface {
/**
* Gets read only phone number settings config object for a bundle.
*
* @param string $entity_type_id
* The entity type ID of the bundle.
* @param string $bundle
* An entity bundle.
*
* @return \Drupal\sms\Entity\PhoneNumberSettingsInterface|null
* A phone number settings entity, or NULL if it does not exist.
*/
public function getPhoneNumberSettings($entity_type_id, $bundle);
/**
* Gets phone number settings for the bundle of an entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity to get settings.
*
* @return \Drupal\sms\Entity\PhoneNumberSettingsInterface|null
* A phone number settings entity, or NULL if it does not exist.
*
* @throws \Drupal\sms\Exception\PhoneNumberSettingsException
* Thrown if entity is not configured for phone numbers.
*/
public function getPhoneNumberSettingsForEntity(EntityInterface $entity);
/**
* Checks if there is a phone number verification for a code.
*
* @param string $code
* A string to check is a verification code.
*
* @return \Drupal\sms\Entity\PhoneNumberVerificationInterface|false
* A phone number verification entity, or FALSE if $code is not a valid
* verification code.
*/
public function getPhoneVerificationByCode($code);
/**
* Gets phone number verifications for a phone number.
*
* This is the primary helper to determine if a phone number is in use.
*
* It is possible for multiple entities to have the same phone number, so this
* helper may return more than one phone verification.
*
* @param string $phone_number
* A phone number.
* @param bool|null $verified
* Whether the returned phone numbers must be verified, or NULL to get all
* regardless of status.
* @param string $entity_type
* An entity type ID to filter.
*
* @return \Drupal\sms\Entity\PhoneNumberVerificationInterface[]
* An array of phone number verification entities, if any.
*/
public function getPhoneVerificationByPhoneNumber($phone_number, $verified = TRUE, $entity_type = NULL);
/**
* Gets a phone number verification for an entity and phone number pair.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* An entity to get phone number verification.
* @param string $phone_number
* A phone number.
*
* @return \Drupal\sms\Entity\PhoneNumberVerificationInterface|null
* The phone number verification for an entity and phone number pair.
*/
public function getPhoneVerificationByEntity(EntityInterface $entity, $phone_number);
/**
* Generates a phone number verification for an entity and phone number pair.
*
* The phone number verification is immediately saved to storage, and an
* SMS is sent to the phone number for verification.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* An entity to get phone number verification.
* @param string $phone_number
* A phone number.
*
* @return \Drupal\sms\Entity\PhoneNumberVerificationInterface|null
* A phone number verification.
*/
public function newPhoneVerification(EntityInterface $entity, $phone_number);
/**
* Detect modifications to phone numbers on an entity.
*
* Detects if phone numbers are modified on an entity. If new phone numbers
* are detected, new phone number verifications are created. If phone numbers
* are removed, the associated phone number verification is deleted.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* Update phone number verifications for this entity.
*/
public function updatePhoneVerificationByEntity(EntityInterface $entity);
/**
* Deletes phone number verifications for an entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* Delete phone number verifications for this entity.
*/
public function deletePhoneVerificationByEntity(EntityInterface $entity);
/**
* Cleans up expired phone number verifications.
*
* Removes phone numbers from entities if setting is verification expires, and
* setting is enabled.
*/
public function purgeExpiredVerifications();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PhoneNumberVerificationInterface:: |
public | function | Deletes phone number verifications for an entity. | 1 |
PhoneNumberVerificationInterface:: |
public | function | Gets read only phone number settings config object for a bundle. | 1 |
PhoneNumberVerificationInterface:: |
public | function | Gets phone number settings for the bundle of an entity. | 1 |
PhoneNumberVerificationInterface:: |
public | function | Checks if there is a phone number verification for a code. | 1 |
PhoneNumberVerificationInterface:: |
public | function | Gets a phone number verification for an entity and phone number pair. | 1 |
PhoneNumberVerificationInterface:: |
public | function | Gets phone number verifications for a phone number. | 1 |
PhoneNumberVerificationInterface:: |
public | function | Generates a phone number verification for an entity and phone number pair. | 1 |
PhoneNumberVerificationInterface:: |
public | function | Cleans up expired phone number verifications. | 1 |
PhoneNumberVerificationInterface:: |
public | function | Detect modifications to phone numbers on an entity. | 1 |