Skip to content
Snippets Groups Projects
Commit 424ccd37 authored by Malcolm Young's avatar Malcolm Young Committed by Shashank Kumar
Browse files

Resolve #3394958 "Sms preview mode"

parent 48e3ca4e
No related branches found
No related tags found
1 merge request!35Resolve #3394958 "Sms preview mode"
......@@ -5,6 +5,7 @@ namespace Drupal\twilio\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Database\Connection;
use Drupal\Core\Url;
use PDO;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......@@ -31,7 +32,7 @@ final class TwilioLogController extends ControllerBase {
/**
* Builds the response.
*/
public function logPage(): array {
public function __invoke(): array {
$build['intro'] = [
'#type' => 'html_tag',
......@@ -59,11 +60,15 @@ final class TwilioLogController extends ControllerBase {
return $build;
}
/**
* @return array
* Array of log entries
*/
public function logs() {
$logs = $this->connection->select('twilio_log', 'tl')
->fields('tl')
->execute()
->fetchAll();
->fetchAllAssoc('id', PDO::FETCH_ASSOC);
return $logs;
}
......
......@@ -53,7 +53,7 @@ function twilio_schema() {
$schema['twilio_log'] = [
'fields' => [
'id' => [
'type' => 'int',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
],
......@@ -75,7 +75,8 @@ function twilio_schema() {
'mediaUrl' => [
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'not null' => FALSE,
'default' => NULL,
],
],
'primary key' => ['id'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment