SmsGatewayPluginBase.php in SMS Framework 8
File
src/Plugin/SmsGatewayPluginBase.php
View source
<?php
namespace Drupal\sms\Plugin;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
abstract class SmsGatewayPluginBase extends PluginBase implements SmsGatewayPluginInterface {
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this
->setConfiguration($configuration);
}
public function getConfiguration() {
return $this->configuration;
}
public function setConfiguration(array $configuration) {
$this->configuration = NestedArray::mergeDeep($this
->defaultConfiguration(), $configuration);
}
public function defaultConfiguration() {
return [];
}
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
return $form;
}
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
}
public function calculateDependencies() {
return [];
}
public function getCreditsBalance() {
return NULL;
}
public function parseDeliveryReports(Request $request, Response $response) {
return [];
}
public function getDeliveryReports(array $message_ids = NULL) {
return [];
}
}