mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-07-10 20:12:53 +00:00
3rdparty
RestControllers
bin
classes
components
models
APIClient.php
AccountImageSettings.php
AdvancedGroupInfo.php
AdvancedUser.php
BaseUniqueObject.php
BaseUniqueObjectFromUser.php
BaseUserModel.php
Comment.php
ConversationInfo.php
ConversationMessage.php
Friend.php
GeneralSettings.php
GroupInfo.php
GroupMember.php
GroupSettings.php
Movie.php
NewAccount.php
NewConversationMessage.php
NewGroup.php
Notification.php
Post.php
SecuritySettings.php
Survey.php
SurveyChoice.php
SurveyResponse.php
UnreadConversation.php
User.php
UserLike.php
.htaccess
APIClients.php
Components.php
DBLibrary.php
URLanalyzer.php
comunicAPI.php
config.php
config
functions
helpers
tests
.gitignore
.htaccess
LICENSE
README.md
db_struct.sql
index.php
init.php
49 lines
957 B
PHP
49 lines
957 B
PHP
<?php
|
|
/**
|
|
* Group member object model
|
|
*
|
|
* @author Pierre HUBERT
|
|
*/
|
|
|
|
class GroupMember extends BaseUniqueObjectFromUser {
|
|
|
|
/**
|
|
* Groups membership levels
|
|
*/
|
|
const ADMINISTRATOR = 0;
|
|
const MODERATOR = 1;
|
|
const MEMBER = 2;
|
|
const INVITED = 3;
|
|
const PENDING = 4; //When the group membership has not been approved yet
|
|
const VISITOR = 5; //Simple visitor
|
|
|
|
//Private fields
|
|
private $group_id = 1;
|
|
private $level = -1;
|
|
|
|
//Set and get group id
|
|
public function set_group_id(int $group_id){
|
|
$this->group_id = $group_id;
|
|
}
|
|
|
|
public function has_group_id() : bool {
|
|
return $this->group_id > -1;
|
|
}
|
|
|
|
public function get_group_id() : int {
|
|
return $this->group_id;
|
|
}
|
|
|
|
//Set and get user membership level
|
|
public function set_level(int $level){
|
|
$this->level = $level;
|
|
}
|
|
|
|
public function has_level() : bool {
|
|
return $this->level > -1;
|
|
}
|
|
|
|
public function get_level() : int {
|
|
return $this->level;
|
|
}
|
|
} |