mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 16:45:17 +00:00
Can get information about a group
This commit is contained in:
29
classes/models/AdvancedGroupInfo.php
Normal file
29
classes/models/AdvancedGroupInfo.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Advanced information about a group model
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
//Make sure that GroupInfo has already been included
|
||||
require_once __DIR__."/GroupInfo.php";
|
||||
|
||||
class AdvancedGroupInfo extends GroupInfo {
|
||||
|
||||
//Private fields
|
||||
private $time_create = -1;
|
||||
|
||||
//Get and set the creation time of the group
|
||||
public function set_time_create(int $time_create){
|
||||
$this->time_create = $time_create;
|
||||
}
|
||||
|
||||
public function has_time_create() : bool {
|
||||
return $this->time_create > -1;
|
||||
}
|
||||
|
||||
public function get_time_create() : int {
|
||||
return $this->time_create;
|
||||
}
|
||||
|
||||
}
|
41
classes/models/GroupInfo.php
Normal file
41
classes/models/GroupInfo.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Group information model
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
class GroupInfo extends BaseUniqueObject {
|
||||
|
||||
//Private fields
|
||||
private $name;
|
||||
private $number_members = -1;
|
||||
|
||||
|
||||
|
||||
//Get and set the name of group
|
||||
public function set_name(string $name){
|
||||
$this->name = $name == "" ? null : $name;
|
||||
}
|
||||
|
||||
public function has_name() : bool {
|
||||
return $this->name != null;
|
||||
}
|
||||
|
||||
public function get_name() : string {
|
||||
return $this->name != null ? $this->name : "null";
|
||||
}
|
||||
|
||||
//Get and set the number of members of the group
|
||||
public function set_number_members(int $number_members){
|
||||
$this->number_members = $number_members;
|
||||
}
|
||||
|
||||
public function has_number_members() : bool {
|
||||
return $this->number_members > -1;
|
||||
}
|
||||
|
||||
public function get_number_members() : int {
|
||||
return $this->number_members;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user