2020-04-26 11:36:41 +02:00
|
|
|
<?php
|
2020-06-19 09:28:58 +02:00
|
|
|
|
2020-04-26 11:36:41 +02:00
|
|
|
namespace OCA\BigBlueButton\Db;
|
|
|
|
|
|
|
|
use JsonSerializable;
|
|
|
|
|
|
|
|
use OCP\AppFramework\Db\Entity;
|
|
|
|
|
2020-06-19 10:49:40 +02:00
|
|
|
/**
|
|
|
|
* @method string getUid()
|
|
|
|
* @method string getName()
|
|
|
|
* @method string getAttendeePassword()
|
|
|
|
* @method string getModeratorPassword()
|
|
|
|
* @method string getWelcome()
|
|
|
|
* @method int getMaxParticipants()
|
|
|
|
* @method bool getRecord()
|
|
|
|
* @method string getUserId()
|
|
|
|
* @method string getAccess()
|
|
|
|
* @method string getPassword()
|
|
|
|
* @method bool getEveryoneIsModerator()
|
2020-08-29 14:37:50 +02:00
|
|
|
* @method bool getRequireModerator()
|
|
|
|
* @method bool getEveryoneIsModerator()
|
2021-01-22 19:12:55 +01:00
|
|
|
* @method string getModeratorToken()
|
2021-04-19 14:47:15 +02:00
|
|
|
* @method bool getListenOnly()
|
|
|
|
* @method bool getMediaCheck()
|
|
|
|
* @method bool getCleanLayout()
|
2021-07-30 12:12:42 +02:00
|
|
|
* @method bool getJoinMuted()
|
2020-06-19 10:49:40 +02:00
|
|
|
* @method void setUid(string $uid)
|
|
|
|
* @method void setName(string $name)
|
|
|
|
* @method void setAttendeePassword(string $pw)
|
|
|
|
* @method void setModeratorPassword(string $pw)
|
|
|
|
* @method void setWelcome(string $welcome)
|
|
|
|
* @method void setMaxParticipants(int $max)
|
|
|
|
* @method void setRecord(bool $record)
|
|
|
|
* @method void setUserId(string $userId)
|
|
|
|
* @method void setAccess(string $access)
|
|
|
|
* @method void setPassword(string $pw)
|
|
|
|
* @method void setEveryoneIsModerator(bool $everyone)
|
2020-08-29 14:37:50 +02:00
|
|
|
* @method void setRequireModerator(bool $require)
|
2021-01-22 19:12:55 +01:00
|
|
|
* @method void setModeratorToken(string $moderatorToken)
|
2021-04-19 14:47:15 +02:00
|
|
|
* @method void setListenOnly(bool $listenOnly)
|
|
|
|
* @method void setMediaCheck(bool $mediaCheck)
|
|
|
|
* @method void setCleanLayout(bool $cleanLayout)
|
2021-07-30 12:12:42 +02:00
|
|
|
* @method void setJoinMuted(bool $joinMuted)
|
2020-06-19 10:49:40 +02:00
|
|
|
*/
|
2020-06-19 09:28:58 +02:00
|
|
|
class Room extends Entity implements JsonSerializable {
|
|
|
|
public const ACCESS_PUBLIC = 'public';
|
|
|
|
public const ACCESS_PASSWORD = 'password';
|
|
|
|
public const ACCESS_WAITING_ROOM = 'waiting_room';
|
2022-03-08 15:09:18 +01:00
|
|
|
public const ACCESS_WAITING_ROOM_ALL = 'waiting_room_all';
|
2020-06-19 09:28:58 +02:00
|
|
|
public const ACCESS_INTERNAL = 'internal';
|
|
|
|
public const ACCESS_INTERNAL_RESTRICTED = 'internal_restricted';
|
2020-06-04 18:56:55 +02:00
|
|
|
|
2022-03-08 15:09:18 +01:00
|
|
|
public const ACCESS = [self::ACCESS_PUBLIC, self::ACCESS_PASSWORD, self::ACCESS_WAITING_ROOM, self::ACCESS_WAITING_ROOM_ALL, self::ACCESS_INTERNAL, self::ACCESS_INTERNAL_RESTRICTED];
|
2020-08-27 17:21:34 +02:00
|
|
|
|
2020-04-26 11:36:41 +02:00
|
|
|
public $uid;
|
|
|
|
public $name;
|
|
|
|
public $attendeePassword;
|
|
|
|
public $moderatorPassword;
|
|
|
|
public $welcome;
|
|
|
|
public $maxParticipants;
|
|
|
|
public $record;
|
|
|
|
public $userId;
|
2020-08-25 13:27:33 +02:00
|
|
|
public $access = self::ACCESS_PUBLIC;
|
2020-06-04 18:56:55 +02:00
|
|
|
public $password;
|
2020-06-17 08:19:54 +02:00
|
|
|
public $everyoneIsModerator;
|
2020-08-29 14:37:50 +02:00
|
|
|
public $requireModerator = false;
|
2020-09-08 17:01:50 +02:00
|
|
|
public $shared = false;
|
2021-01-22 19:12:55 +01:00
|
|
|
public $moderatorToken;
|
2021-04-19 14:47:15 +02:00
|
|
|
public $listenOnly;
|
|
|
|
public $mediaCheck;
|
|
|
|
public $cleanLayout;
|
2021-07-30 12:12:42 +02:00
|
|
|
public $joinMuted;
|
2020-04-26 11:36:41 +02:00
|
|
|
|
2020-06-19 09:28:58 +02:00
|
|
|
public function __construct() {
|
2020-04-27 17:16:18 +02:00
|
|
|
$this->addType('maxParticipants', 'integer');
|
|
|
|
$this->addType('record', 'boolean');
|
2020-06-17 08:19:54 +02:00
|
|
|
$this->addType('everyoneIsModerator', 'boolean');
|
2020-08-29 14:37:50 +02:00
|
|
|
$this->addType('requireModerator', 'boolean');
|
2020-09-08 17:01:50 +02:00
|
|
|
$this->addType('shared', 'boolean');
|
2021-04-19 14:47:15 +02:00
|
|
|
$this->addType('listenOnly', 'boolean');
|
|
|
|
$this->addType('mediaCheck', 'boolean');
|
|
|
|
$this->addType('cleanLayout', 'boolean');
|
2021-07-30 12:12:42 +02:00
|
|
|
$this->addType('joinMuted', 'boolean');
|
2020-04-27 17:16:18 +02:00
|
|
|
}
|
|
|
|
|
2020-06-19 09:28:58 +02:00
|
|
|
public function jsonSerialize(): array {
|
2020-04-26 11:36:41 +02:00
|
|
|
return [
|
2021-07-26 15:44:14 +02:00
|
|
|
'id' => $this->id,
|
|
|
|
'uid' => $this->uid,
|
|
|
|
'userId' => $this->userId,
|
|
|
|
'name' => $this->name,
|
|
|
|
'welcome' => $this->welcome,
|
|
|
|
'maxParticipants' => (int) $this->maxParticipants,
|
|
|
|
'record' => boolval($this->record),
|
|
|
|
'access' => $this->access,
|
|
|
|
'password' => $this->password,
|
2020-06-17 08:19:54 +02:00
|
|
|
'everyoneIsModerator' => boolval($this->everyoneIsModerator),
|
2021-07-26 15:44:14 +02:00
|
|
|
'requireModerator' => boolval($this->requireModerator),
|
|
|
|
'shared' => boolval($this->shared),
|
|
|
|
'moderatorToken' => $this->moderatorToken,
|
|
|
|
'listenOnly' => boolval($this->listenOnly),
|
|
|
|
'mediaCheck' => boolval($this->mediaCheck),
|
|
|
|
'cleanLayout' => boolval($this->cleanLayout),
|
2021-07-30 12:12:42 +02:00
|
|
|
'joinMuted' => boolval($this->joinMuted),
|
2020-04-26 11:36:41 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|