From 32c6495e21342fb589b8d617fbe9ac0d99591232 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 7 Nov 2010 12:01:57 +0100 Subject: add TableUpstream->getChannels() --- class/TableUpstream.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'class') diff --git a/class/TableUpstream.php b/class/TableUpstream.php index 6630377..fbf7b98 100644 --- a/class/TableUpstream.php +++ b/class/TableUpstream.php @@ -95,5 +95,27 @@ class TableUpstream extends CommonTable } return $this->add(array_merge($key, $input)); } + + /** + * return the channel list for type of package + * + * @param string $type of package + * + * @return hashtable + */ + public function getChannels($type) { + + $crit = array( + 'DISTINCT' => true, + 'FIELDS' => 'channel', + 'ORDER' => 'channel', + 'type' => $type + ); + $tab = array(); + foreach ($this->request($crit) as $data) { + $tab[] = $data['channel']; + } + return $tab; + } } ?> \ No newline at end of file -- cgit