Completed
Push — master ( f461e1...6710d9 )
by Ghazi
01:43
created

Attendee::hasVideo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
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
class Attendee
22
{
23
    /**
24
     * @var string
25
     */
26
    private $userId;
27
28
    /**
29
     * @var string
30
     */
31
    private $fullName;
32
33
    /**
34
     * @var string
35
     */
36
    private $role;
37
38
    /**
39
     * @var bool
40
     */
41
    private $isPresenter;
42
43
    /**
44
     * @var bool
45
     */
46
    private $isListeningOnly;
47
48
    /**
49
     * @var bool
50
     */
51
    private $hasJoinedVoice;
52
53
    /**
54
     * @var bool
55
     */
56
    private $hasVideo;
57
58
    /**
59
     * @var array
60
     */
61
    private $customData;
62
63
    /**
64
     * @var string
65
     */
66
    private $clientType;
67
68
    /**
69
     * Attendee constructor.
70
     * @param $xml \SimpleXMLElement
71
     */
72
    public function __construct($xml)
73
    {
74
        $this->userId          = $xml->userID->__toString();
75
        $this->fullName        = $xml->fullName->__toString();
76
        $this->role            = $xml->role->__toString();
77
        $this->isPresenter     = $xml->isPresenter->__toString() === 'true';
78
        $this->isListeningOnly = $xml->isListeningOnly->__toString() === 'true';
79
        $this->hasJoinedVoice  = $xml->hasJoinedVoice->__toString() === 'true';
80
        $this->hasVideo        = $xml->hasVideo->__toString() === 'true';
81
        $this->clientType      = $xml->clientType->__toString();
82
83
        foreach ($xml->customdata->children() as $data) {
84
            $this->customData[$data->getName()] = $data->__toString();
85
        }
86
    }
87
88
    /**
89
     * @return string
90
     */
91
    public function getUserId()
92
    {
93
        return $this->userId;
94
    }
95
96
    /**
97
     * @return string
98
     */
99
    public function getFullName()
100
    {
101
        return $this->fullName;
102
    }
103
104
    /**
105
     * @return string
106
     */
107
    public function getRole()
108
    {
109
        return $this->role;
110
    }
111
112
    /**
113
     * @return bool
114
     */
115
    public function isPresenter()
116
    {
117
        return $this->isPresenter;
118
    }
119
120
    /**
121
     * @return bool
122
     */
123
    public function isListeningOnly()
124
    {
125
        return $this->isListeningOnly;
126
    }
127
128
    /**
129
     * @return bool
130
     */
131
    public function hasJoinedVoice()
132
    {
133
        return $this->hasJoinedVoice;
134
    }
135
136
    /**
137
     * @return bool
138
     */
139
    public function hasVideo()
140
    {
141
        return $this->hasVideo;
142
    }
143
144
    /**
145
     * @return string
146
     */
147
    public function getClientType()
148
    {
149
        return $this->clientType;
150
    }
151
152
    /**
153
     * @return array
154
     */
155
    public function getCustomData()
156
    {
157
        return $this->customData;
158
    }
159
}
160