Subversion-Projekte lars-tiefland.nagios-php

Revision

Revision 84 | Revision 106 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 84 Revision 86
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile -... Zeile 2...
-
 
2
 
-
 
3
    /**
-
 
4
     * @package nagios-php
-
 
5
     * @author Lars Tiefland <ltiefland@gmail.com>
-
 
6
     * @copyright 2013
-
 
7
     * @version $Rev: 86 $
-
 
8
     */
-
 
9
 
-
 
10
    // $Id: hostgroup.php 86 2013-01-02 13:28:36Z lars $
-
 
11
 
-
 
12
    /**
-
 
13
     * hostGroup
-
 
14
     * 
-
 
15
     * @package nagios-php
-
 
16
     * @author Lars Tiefland
-
 
17
     * @copyright 2013
-
 
18
     * @version $Id: hostgroup.php 86 2013-01-02 13:28:36Z lars $
-
 
19
     * @access public
2
 
20
     */
3
    class hostGroup
21
    class hostGroup
4
    {
22
    {
5
        public $alias;
23
        public $alias;
6
        public $hostgroup_id;
24
        public $hostgroup_id;
-
 
25
        public $members;
-
 
26
        /**
-
 
27
         * hostGroup::__construct()
-
 
28
         * 
-
 
29
         * @param mixed $id
-
 
30
         * @return
7
        public $members;
31
         */
8
        public function __construct( $id )
32
        public function __construct( $id )
9
        {
33
        {
10
            $sql = "SELECT
34
            $sql = "SELECT
11
                    alias,
35
                    alias,
Zeile 24... Zeile 48...
24
                $this->$feld = $wert;
48
                $this->$feld = $wert;
25
            }
49
            }
26
            $this->members = $this->getMemberList( $id );
50
            $this->members = $this->getMemberList( $id );
27
        }
51
        }
Zeile -... Zeile 52...
-
 
52
 
-
 
53
        /**
-
 
54
         * hostGroup::getList()
-
 
55
         * 
-
 
56
         * @return
28
 
57
         */
29
        public static function getList()
58
        public static function getList()
30
        {
59
        {
31
            $sql="SELECT
60
            $sql="SELECT
32
                    hostgroup_id
61
                    hostgroup_id
Zeile 41... Zeile 70...
41
                $ret[] = new hostGroup( $row["hostgroup_id"] );
70
                $ret[] = new hostGroup( $row["hostgroup_id"] );
42
            }
71
            }
43
            return $ret;
72
            return $ret;
44
        }
73
        }
Zeile -... Zeile 74...
-
 
74
 
-
 
75
        /**
-
 
76
         * hostGroup::getMemberList()
-
 
77
         * 
-
 
78
         * @param mixed $hg_id
-
 
79
         * @return
45
 
80
         */
46
        public function getMemberList( $hg_id )
81
        public function getMemberList( $hg_id )
47
        {
82
        {
48
            $sql = "SELECT
83
            $sql = "SELECT
49
                    host_object_id
84
                    host_object_id