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

GetMeetingInfoResponse::getMetadata()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 3
nc 3
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\Responses;
20
21
use BigBlueButton\Core\Attendee;
22
use BigBlueButton\Core\MeetingInfo;
23
24
/**
25
 * Class GetMeetingInfoResponse
26
 * @package BigBlueButton\Responses
27
 */
28
class GetMeetingInfoResponse extends BaseResponse
29
{
30
    /**
31
     * @var MeetingInfo
32
     */
33
    private $meetingInfo;
34
35
    /**
36
     * @var Attendee[]
37
     */
38
    private $attendees;
39
40
    /**
41
     * @var array
42
     */
43
    private $metas;
44
45
    /**
46
     * @return MeetingInfo
47
     */
48
    public function getMeetingInfo()
49
    {
50
        if ($this->meetingInfo !== null) {
51
            return $this->meetingInfo;
52
        } else {
53
            $this->meetingInfo = new MeetingInfo($this->rawXml);
54
        }
55
56
        return $this->meetingInfo;
57
    }
58
59
    /**
60
     * @return Attendee[]
61
     */
62
    public function getAttendees()
63
    {
64
        if ($this->attendees !== null) {
65
            return $this->attendees;
66
        } else {
67
            $this->attendees = [];
68
            foreach ($this->rawXml->attendees->attendee as $attendeeXml) {
69
                $this->attendees[] = new Attendee($attendeeXml);
70
            }
71
        }
72
73
        return $this->attendees;
74
    }
75
76
    /**
77
     * @return array
78
     */
79
    public function getMetadata()
80
    {
81
        if ($this->metas !== null) {
82
            return $this->metas;
83
        } else {
84
            $this->metas = [];
85
            foreach ($this->rawXml->metadata->children() as $metadataXml) {
86
                $this->metas[$metadataXml->getName()] = $metadataXml->__toString();
87
            }
88
        }
89
90
        return $this->metas;
91
    }
92
}
93