Skip to content
Snippets Groups Projects

Resolve #3394958 "Sms preview mode"

Merged Malcolm Young requested to merge issue/twilio-3394958:3394958-sms-preview-mode into 8.x-3.x
All threads resolved!
2 files
+ 10
4
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -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;
}
Loading