2020-08-27 17:21:34 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace OCA\BigBlueButton\Db;
|
|
|
|
|
|
|
|
use JsonSerializable;
|
|
|
|
|
|
|
|
use OCP\AppFramework\Db\Entity;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @method int getRoomId()
|
|
|
|
* @method int getMaxRooms()
|
|
|
|
* @method string getRoomTypes()
|
|
|
|
* @method int getMaxParticipants()
|
|
|
|
* @method bool getAllowRecording()
|
|
|
|
* @method void setRoomId(string $id)
|
|
|
|
* @method void setMaxRooms(int $number)
|
|
|
|
* @method void setMaxParticipants(int $number)
|
|
|
|
* @method void setAllowRecording(bool $allow)
|
2024-10-22 15:30:10 +02:00
|
|
|
* @method void setGroupName(string $groupName)
|
2020-08-27 17:21:34 +02:00
|
|
|
*/
|
|
|
|
class Restriction extends Entity implements JsonSerializable {
|
|
|
|
public const ALL_ID = '';
|
|
|
|
|
|
|
|
protected $groupId;
|
2024-10-22 15:30:10 +02:00
|
|
|
protected $groupName;
|
2020-08-27 17:21:34 +02:00
|
|
|
protected $maxRooms = -1;
|
|
|
|
protected $roomTypes = '[]';
|
|
|
|
protected $maxParticipants = -1;
|
|
|
|
protected $allowRecording = true;
|
|
|
|
|
|
|
|
public function __construct() {
|
2020-09-02 10:54:51 +02:00
|
|
|
$this->addType('maxRooms', 'integer');
|
|
|
|
$this->addType('maxParticipants', 'integer');
|
|
|
|
$this->addType('allowRecording', 'boolean');
|
2020-08-27 17:21:34 +02:00
|
|
|
}
|
|
|
|
|
2024-12-05 09:59:22 +01:00
|
|
|
public function setGroupName(?string $groupName) {
|
|
|
|
$this->groupName = $groupName ?? '';
|
2024-10-22 15:30:10 +02:00
|
|
|
}
|
|
|
|
|
2020-08-27 17:21:34 +02:00
|
|
|
public function jsonSerialize(): array {
|
|
|
|
return [
|
2021-07-26 15:44:14 +02:00
|
|
|
'id' => $this->id,
|
|
|
|
'groupId' => $this->groupId,
|
2024-10-22 15:30:10 +02:00
|
|
|
'groupName' => $this->groupName,
|
2021-07-26 15:44:14 +02:00
|
|
|
'maxRooms' => (int) $this->maxRooms,
|
|
|
|
'roomTypes' => \json_decode($this->roomTypes),
|
2020-08-27 17:21:34 +02:00
|
|
|
'maxParticipants' => (int) $this->maxParticipants,
|
2021-07-26 15:44:14 +02:00
|
|
|
'allowRecording' => boolval($this->allowRecording),
|
2020-08-27 17:21:34 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|