Completed
Push — master ( 80acf8...df3da4 )
by Ghazi
08:49
created

MeetingInfo::getMetas()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
4
 *
5
 * Copyright (c) 2016-2018 BigBlueButton Inc. and by respective authors (see below).
6
 *
7
 * This program is free software; you can redistribute it and/or modify it under the
8
 * terms of the GNU Lesser General Public License as published by the Free Software
9
 * Foundation; either version 3.0 of the License, or (at your option) any later
10
 * version.
11
 *
12
 * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14
 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public License along
17
 * with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18
 */
19
namespace BigBlueButton\Core;
20
21
/**
22
 * Class MeetingInfo
23
 * @package BigBlueButton\Core
24
 */
25
class MeetingInfo extends Meeting
26
{
27
    /**
28
     * @var string
29
     */
30
    private $internalMeetingId;
31
32
    /**
33
     * @var bool
34
     */
35
    private $isRecording;
36
37
    /**
38
     * @var double
39
     */
40
    private $startTime;
41
42
    /**
43
     * @var double
44
     */
45
    private $endTime;
46
47
    /**
48
     * @var int
49
     */
50
    private $maxUsers;
51
52
    /**
53
     * @var int
54
     */
55
    private $moderatorCount;
56
57
    /**
58
     * @var array
59
     */
60
    private $metas;
61
62
    /**
63
     * MeetingInfo constructor.
64
     * @param $xml \SimpleXMLElement
65
     */
66
    public function __construct($xml)
67
    {
68
        parent::__construct($xml);
69
        $this->internalMeetingId = $xml->internalMeetingID->__toString();
70
        $this->isRecording       = $xml->recording->__toString() === 'true';
71
        $this->startTime         = (float) $xml->startTime;
72
        $this->endTime           = (float) $xml->endTime;
73
        $this->maxUsers          = (int) $xml->maxUsers->__toString();
74
        $this->moderatorCount    = (int) $xml->moderatorCount->__toString();
75
76
        foreach ($xml->metadata->children() as $meta) {
77
            $this->metas[$meta->getName()] = $meta->__toString();
78
        }
79
    }
80
81
    /**
82
     * @return string
83
     */
84
    public function getInternalMeetingId()
85
    {
86
        return $this->internalMeetingId;
87
    }
88
89
    /**
90
     * @return bool
91
     */
92
    public function isRecording()
93
    {
94
        return $this->isRecording;
95
    }
96
97
    /**
98
     * @return double
99
     */
100
    public function getStartTime()
101
    {
102
        return $this->startTime;
103
    }
104
105
    /**
106
     * @return double
107
     */
108
    public function getEndTime()
109
    {
110
        return $this->endTime;
111
    }
112
113
    /**
114
     * @return int
115
     */
116
    public function getMaxUsers()
117
    {
118
        return $this->maxUsers;
119
    }
120
121
    /**
122
     * @return int
123
     */
124
    public function getModeratorCount()
125
    {
126
        return $this->moderatorCount;
127
    }
128
129
    /**
130
     * @return array
131
     */
132
    public function getMetas()
133
    {
134
        return $this->metas;
135
    }
136
}
137