Skip to content

Commit a1d3d82

Browse files
committed
Remove MeetingInfo class and use Meeting class instead as getMeetings and getMeetingInfo returns the same set of information since BBB 2.0
1 parent 6710d96 commit a1d3d82

File tree

6 files changed

+154
-195
lines changed

6 files changed

+154
-195
lines changed

src/Core/Meeting.php

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
*/
2626
class Meeting
2727
{
28+
29+
/**
30+
* @var \SimpleXMLElement
31+
*/
32+
protected $rawXml;
33+
2834
/**
2935
* @var string
3036
*/
@@ -105,12 +111,53 @@ class Meeting
105111
*/
106112
private $hasUserJoined;
107113

114+
/**
115+
* @var string
116+
*/
117+
private $internalMeetingId;
118+
119+
/**
120+
* @var bool
121+
*/
122+
private $isRecording;
123+
124+
/**
125+
* @var double
126+
*/
127+
private $startTime;
128+
129+
/**
130+
* @var double
131+
*/
132+
private $endTime;
133+
134+
/**
135+
* @var int
136+
*/
137+
private $maxUsers;
138+
139+
/**
140+
* @var int
141+
*/
142+
private $moderatorCount;
143+
144+
/**
145+
* @var Attendee[]
146+
*/
147+
private $attendees;
148+
149+
/**
150+
* @var array
151+
*/
152+
private $metas;
153+
108154
/**
109155
* Meeting constructor.
110156
* @param $xml \SimpleXMLElement
111157
*/
112158
public function __construct($xml)
113159
{
160+
$this->rawXml = $xml;
114161
$this->meetingId = $xml->meetingID->__toString();
115162
$this->meetingName = $xml->meetingName->__toString();
116163
$this->creationTime = (float) $xml->createTime;
@@ -127,6 +174,12 @@ public function __construct($xml)
127174
$this->videoCount = (int) $xml->videoCount;
128175
$this->duration = (int) $xml->duration;
129176
$this->hasUserJoined = $xml->hasUserJoined->__toString() === 'true';
177+
$this->internalMeetingId = $xml->internalMeetingID->__toString();
178+
$this->isRecording = $xml->recording->__toString() === 'true';
179+
$this->startTime = (float) $xml->startTime;
180+
$this->endTime = (float) $xml->endTime;
181+
$this->maxUsers = (int) $xml->maxUsers->__toString();
182+
$this->moderatorCount = (int) $xml->moderatorCount->__toString();
130183
}
131184

132185
/**
@@ -256,4 +309,82 @@ public function hasUserJoined()
256309
{
257310
return $this->hasUserJoined;
258311
}
312+
313+
/**
314+
* @return string
315+
*/
316+
public function getInternalMeetingId()
317+
{
318+
return $this->internalMeetingId;
319+
}
320+
321+
/**
322+
* @return bool
323+
*/
324+
public function isRecording()
325+
{
326+
return $this->isRecording;
327+
}
328+
329+
/**
330+
* @return double
331+
*/
332+
public function getStartTime()
333+
{
334+
return $this->startTime;
335+
}
336+
337+
/**
338+
* @return double
339+
*/
340+
public function getEndTime()
341+
{
342+
return $this->endTime;
343+
}
344+
345+
/**
346+
* @return int
347+
*/
348+
public function getMaxUsers()
349+
{
350+
return $this->maxUsers;
351+
}
352+
353+
/**
354+
* @return int
355+
*/
356+
public function getModeratorCount()
357+
{
358+
return $this->moderatorCount;
359+
}
360+
361+
/**
362+
* @return Attendee[]
363+
*/
364+
public function getAttendees()
365+
{
366+
if ($this->attendees === null) {
367+
$this->attendees = [];
368+
foreach ($this->rawXml->attendees->attendee as $attendeeXml) {
369+
$this->attendees[] = new Attendee($attendeeXml);
370+
}
371+
}
372+
373+
return $this->attendees;
374+
}
375+
376+
/**
377+
* @return array
378+
*/
379+
public function getMetas()
380+
{
381+
if ($this->metas === null) {
382+
$this->metas = [];
383+
foreach ($this->rawXml->metadata->children() as $metadataXml) {
384+
$this->metas[$metadataXml->getName()] = $metadataXml->__toString();
385+
}
386+
}
387+
388+
return $this->metas;
389+
}
259390
}

src/Core/MeetingInfo.php

Lines changed: 0 additions & 136 deletions
This file was deleted.

src/Responses/GetMeetingInfoResponse.php

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
*/
1919
namespace BigBlueButton\Responses;
2020

21-
use BigBlueButton\Core\Attendee;
22-
use BigBlueButton\Core\MeetingInfo;
21+
use BigBlueButton\Core\Meeting;
2322

2423
/**
2524
* Class GetMeetingInfoResponse
@@ -28,59 +27,19 @@
2827
class GetMeetingInfoResponse extends BaseResponse
2928
{
3029
/**
31-
* @var MeetingInfo
30+
* @var Meeting
3231
*/
33-
private $meetingInfo;
32+
private $meeting;
3433

3534
/**
36-
* @var Attendee[]
35+
* @return Meeting
3736
*/
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-
$this->meetingInfo = new MeetingInfo($this->rawXml);
52-
}
53-
54-
return $this->meetingInfo;
55-
}
56-
57-
/**
58-
* @return Attendee[]
59-
*/
60-
public function getAttendees()
61-
{
62-
if ($this->attendees === null) {
63-
$this->attendees = [];
64-
foreach ($this->rawXml->attendees->attendee as $attendeeXml) {
65-
$this->attendees[] = new Attendee($attendeeXml);
66-
}
67-
}
68-
69-
return $this->attendees;
70-
}
71-
72-
/**
73-
* @return array
74-
*/
75-
public function getMetadata()
37+
public function getMeeting()
7638
{
77-
if ($this->metas === null) {
78-
$this->metas = [];
79-
foreach ($this->rawXml->metadata->children() as $metadataXml) {
80-
$this->metas[$metadataXml->getName()] = $metadataXml->__toString();
81-
}
39+
if ($this->meeting === null) {
40+
$this->meeting = new Meeting($this->rawXml);
8241
}
8342

84-
return $this->metas;
43+
return $this->meeting;
8544
}
8645
}

tests/Parameters/JoinMeetingParametersTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public function testJoinMeetingParameters()
3434
$this->assertEquals($params['webVoiceConf'], $joinMeetingParams->getWebVoiceConf());
3535
$this->assertEquals($params['creationTime'], $joinMeetingParams->getCreationTime());
3636
$this->assertEquals($params['userdata_countrycode'], $joinMeetingParams->getUserData('countrycode'));
37+
$this->assertEquals($params['userdata_email'], $joinMeetingParams->getUserData('email'));
38+
$this->assertEquals($params['userdata_commercial'], $joinMeetingParams->getUserData('commercial'));
3739

3840
// Test setters that are ignored by the constructor
3941
$joinMeetingParams->setMeetingId($newId = $this->faker->uuid);

0 commit comments

Comments
 (0)