From 267d48f640cdcf9607a0aa4b5d0c4742bf8ac829 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 25 Nov 2011 17:33:59 -0500 Subject: [PATCH] SAAS-82: Add "airtime-system --status" command - add a function that returns just global data of stream setting --- .../application/models/StreamSetting.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/StreamSetting.php b/airtime_mvc/application/models/StreamSetting.php index a3c416ed4..d14843d8b 100644 --- a/airtime_mvc/application/models/StreamSetting.php +++ b/airtime_mvc/application/models/StreamSetting.php @@ -21,7 +21,23 @@ class Application_Model_StreamSetting { return $ids; } - + + /* Retruns only global data as array*/ + public static function getGlobalData(){ + global $CC_DBC; + $sql = "SELECT * " + ."FROM cc_stream_setting " + ."WHERE keyname IN ('output_sound_device', 'icecast_vorbis_metadata')"; + + $rows = $CC_DBC->getAll($sql); + $data = array(); + + foreach($rows as $row){ + $data[$row["keyname"]] = $row["value"]; + } + + return $data; + } /* Returns all information related to a specific stream. An example * of a stream id is 's1' or 's2'. */ public static function getStreamData($p_streamId){