You are here

interface PhoneNumberProviderInterface in SMS Framework 2.x

Same name and namespace in other branches
  1. 8 src/Provider/PhoneNumberProviderInterface.php \Drupal\sms\Provider\PhoneNumberProviderInterface
  2. 2.1.x src/Provider/PhoneNumberProviderInterface.php \Drupal\sms\Provider\PhoneNumberProviderInterface

Interface for phone number provider.

Hierarchy

Expanded class hierarchy of PhoneNumberProviderInterface

All classes that implement PhoneNumberProviderInterface

File

src/Provider/PhoneNumberProviderInterface.php, line 13

Namespace

Drupal\sms\Provider
View source
interface PhoneNumberProviderInterface {

  /**
   * Gets phone numbers for an entity.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   An entity to get phone numbers.
   * @param bool|null $verified
   *   Whether the returned phone numbers must be verified, or NULL to get all
   *   phone numbers regardless of status.
   *
   * @return string[]
   *   An array of phone numbers.
   */
  public function getPhoneNumbers(EntityInterface $entity, $verified = TRUE);

  /**
   * Sends an SMS to an entity.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity to send an SMS.
   * @param \Drupal\sms\Message\SmsMessageInterface $sms_message
   *   The SMS message to send to the entity.
   *
   * @return \Drupal\sms\Message\SmsMessageResultInterface|false
   *   The message result from the gateway.
   *
   * @throws \Drupal\sms\Exception\NoPhoneNumberException
   *   Thrown if entity does not have a phone number.
   */
  public function sendMessage(EntityInterface $entity, SmsMessageInterface $sms_message);

}

Members

Namesort descending Modifiers Type Description Overrides
PhoneNumberProviderInterface::getPhoneNumbers public function Gets phone numbers for an entity. 1
PhoneNumberProviderInterface::sendMessage public function Sends an SMS to an entity. 1