You are here

class DeliveryReportController in SMS Framework 8

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

Provides delivery reports acknowledgement and passes to the correct gateway.

Hierarchy

Expanded class hierarchy of DeliveryReportController

File

src/DeliveryReportController.php, line 14

Namespace

Drupal\sms
View source
class DeliveryReportController implements ContainerInjectionInterface {

  /**
   * The SMS Provider.
   *
   * @var \Drupal\sms\Provider\SmsProviderInterface
   */
  protected $smsProvider;

  /**
   * The request stack.
   *
   * @var \Symfony\Component\HttpFoundation\RequestStack
   */
  protected $requestStack;

  /**
   * Creates an new delivery report controller.
   *
   * @param \Drupal\sms\Provider\SmsProviderInterface $sms_provider
   *   The SMS service provider.
   */
  public function __construct(SmsProviderInterface $sms_provider) {
    $this->smsProvider = $sms_provider;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container
      ->get('sms.provider'));
  }

  /**
   * Acknowledges delivery reports and passes them to the correct gateway.
   *
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   The current request.
   * @param \Drupal\sms\Entity\SmsGatewayInterface $sms_gateway
   *   The gateway which is handling the the delivery report.
   *
   * @return \Symfony\Component\HttpFoundation\Response
   *   A response object to return.
   */
  public function processDeliveryReport(Request $request, SmsGatewayInterface $sms_gateway) {
    return $this->smsProvider
      ->processDeliveryReport($request, $sms_gateway);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeliveryReportController::$requestStack protected property The request stack.
DeliveryReportController::$smsProvider protected property The SMS Provider.
DeliveryReportController::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create
DeliveryReportController::processDeliveryReport public function Acknowledges delivery reports and passes them to the correct gateway.
DeliveryReportController::__construct public function Creates an new delivery report controller.