2018-07-21 13:34:59 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace LibreNMS\Alert;
|
|
|
|
|
|
|
|
|
|
use LibreNMS\Interfaces\Alert\Transport as TransportInterface;
|
|
|
|
|
|
|
|
|
|
abstract class Transport implements TransportInterface
|
|
|
|
|
{
|
|
|
|
|
protected $config;
|
|
|
|
|
|
2018-08-17 22:38:00 +01:00
|
|
|
/**
|
|
|
|
|
* Transport constructor.
|
|
|
|
|
* @param null $transport_id
|
|
|
|
|
*/
|
2018-07-21 13:34:59 -06:00
|
|
|
public function __construct($transport_id = null)
|
|
|
|
|
{
|
|
|
|
|
if (!empty($transport_id)) {
|
|
|
|
|
$sql = "SELECT `transport_config` FROM `alert_transports` WHERE `transport_id`=?";
|
|
|
|
|
$this->config = json_decode(dbFetchCell($sql, [$transport_id]), true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|