Groups
Group contain three properties (id,groupName,description).
id property refers to the group primary id, it's integer number.
groupName property refers to the group name, It's short string.
description property refers to the group description, It's long text.
Create Group example:
$group = new Group(7,"Article Editors","Group of article editors users.");
Or:
$group = new Group(groupName:"Article Editors",description:"Group of article editors users.");
Group class contains these methods you can use:
getId()
setId(int $id)
getGroupName()
setGroupName(string $groupName)
getDescription()
setDescription(string $description)
Work With UGRPM
Insert group to database, retrieve group(s) by (id,groupName) ,get all groups and remove group.
use Jsalam\UGRPM\Group;
use Jsalam\UGRPM\UGRPM;
$ugrpm = new UGRPM($connect);
$group = $ugrpm->createGroup(new Group(groupName:"Editors",description:"Editors Group"));
$group->setDescription("Group of Editors");
$ugrpm->updateGroup($group);
$group1 = $ugrpm->getGroupById(33);
$group2 = $ugrpm->getGroupByGroupName("Gallary Managers");
$allGroups = $ugrpm->getAllGroups();// array of groups.
$ugrpm->removeGroup($group);