Completed
Push — master ( 9d9aa3...aeab87 )
by Ghazi
04:57
created

Record::isPublished()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
4
 *
5
 * Copyright (c) 2016 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 Record
23
 * @package BigBlueButton\Core
24
 */
25
class Record
26
{
27
    private $recordId;
28
    private $meetingId;
29
    private $name;
30
    private $isPublished;
31
    private $state;
32
    private $startTime;
33
    private $endTime;
34
    private $playbackType;
35
    private $playbackUrl;
36
    private $playbackLength;
37
    private $metas;
38
39
    /**
40
     * Record constructor.
41
     * @param $xml \SimpleXMLElement
42
     */
43
    public function __construct($xml)
44
    {
45
        $this->recordId       = $xml->recordID->__toString();
46
        $this->meetingId      = $xml->meetingID->__toString();
47
        $this->name           = $xml->name->__toString();
48
        $this->isPublished    = $xml->published->__toString() == 'true';
49
        $this->state          = $xml->state->__toString();
50
        $this->startTime      = doubleval($xml->startTime->__toString());
51
        $this->endTime        = doubleval($xml->endTime->__toString());
52
        $this->playbackType   = $xml->playback->format->type->__toString();
53
        $this->playbackUrl    = $xml->playback->format->url->__toString();
54
        $this->playbackLength = intval($xml->playback->format->length->__toString());
55
56
        foreach ($xml->metadata->children() as $meta) {
57
            $this->metas[$meta->getName()] = $meta->__toString();
58
        }
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getRecordId()
65
    {
66
        return $this->recordId;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getMeetingId()
73
    {
74
        return $this->meetingId;
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getName()
81
    {
82
        return $this->name;
83
    }
84
85
    /**
86
     * @return boolean
87
     */
88
    public function isPublished()
89
    {
90
        return $this->isPublished;
91
    }
92
93
    /**
94
     * @return string
95
     */
96
    public function getState()
97
    {
98
        return $this->state;
99
    }
100
101
    /**
102
     * @return string
103
     */
104
    public function getStartTime()
105
    {
106
        return $this->startTime;
107
    }
108
109
    /**
110
     * @return string
111
     */
112
    public function getEndTime()
113
    {
114
        return $this->endTime;
115
    }
116
117
    /**
118
     * @return string
119
     */
120
    public function getPlaybackType()
121
    {
122
        return $this->playbackType;
123
    }
124
125
    /**
126
     * @return string
127
     */
128
    public function getPlaybackUrl()
129
    {
130
        return $this->playbackUrl;
131
    }
132
133
    /**
134
     * @return string
135
     */
136
    public function getPlaybackLength()
137
    {
138
        return $this->playbackLength;
139
    }
140
141
    /**
142
     * @return array
143
     */
144
    public function getMetas()
145
    {
146
        return $this->metas;
147
    }
148
}
149