Added registration levels

This commit is contained in:
Pierre HUBERT 2018-07-05 07:48:51 +02:00
parent fd4259c38d
commit e35323915f

View File

@ -15,12 +15,10 @@ class GroupInfo extends BaseUniqueObject {
const PRIVATE_GROUP = 1; const PRIVATE_GROUP = 1;
const SECRET_GROUP = 2; const SECRET_GROUP = 2;
//Private fields //Registration levels
private $name; const OPEN_REGISTRATION = 0;
private $number_members = -1; const MODERATED_REGISTRATION = 1;
private $logo; const CLOSED_REGISTRATION = 2;
private $membership_level = -1;
private $visiblity = -1;
//User access to a group //User access to a group
const NO_ACCESS = 0; //Can not even know if the group exists or not const NO_ACCESS = 0; //Can not even know if the group exists or not
@ -38,6 +36,14 @@ class GroupInfo extends BaseUniqueObject {
const PENDING = 4; const PENDING = 4;
const VISITOR = 5; const VISITOR = 5;
//Private fields
private $name;
private $number_members = -1;
private $logo;
private $membership_level = -1;
private $visiblity = -1;
private $registration_level = -1;
//Get and set the name of group //Get and set the name of group
public function set_name(string $name){ public function set_name(string $name){
$this->name = $name == "" ? null : $name; $this->name = $name == "" ? null : $name;
@ -117,4 +123,17 @@ class GroupInfo extends BaseUniqueObject {
public function get_visibility() : int { public function get_visibility() : int {
return $this->visibility; return $this->visibility;
} }
//Get and set registration levels
public function set_registration_level(int $registration_level){
$this->registration_level = $registration_level;
}
public function has_registration_level() : bool {
return $this->registration_level > -1;
}
public function get_registration_level() : int {
return $this->registration_level;
}
} }