XOOPS member handler class. This class provides simple interface (a facade class) for handling groups/users/ membership data.
Methods | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct(XoopsDatabase $db)
constructor
constructor |
# | ||||||||
public
&
|
createGroup(): XoopsGroup
create a new group
create a new group ReturnsXoopsGroup reference to the new group |
# | ||||||||
public
|
createUser(): XoopsUser
create a new user
create a new user Returnsreference to the new user |
# | ||||||||
public
|
getGroup(int $id): XoopsGroup|false
retrieve a group
retrieve a group Parameters
ReturnsXoopsGroup reference to the group |
# | ||||||||
public
|
getUser(int $id): XoopsUser
retrieve a user
retrieve a user Parameters
Returnsreference to the user |
# | ||||||||
public
|
deleteGroup(XoopsGroup $group): bool
delete a group
delete a group Parameters
ReturnsFALSE if failed |
# | ||||||||
public
|
deleteUser(XoopsUser $user): bool
delete a user
delete a user Parameters
ReturnsFALSE if failed |
# | ||||||||
public
|
insertGroup(XoopsGroup $group): bool
insert a group into the database
insert a group into the database Parameters
ReturnsTRUE if already in database and unchanged FALSE on failure |
# | ||||||||
public
|
insertUser(XoopsUser $user, bool $force = false): bool
insert a user into the database
insert a user into the database Parameters
ReturnsTRUE if already in database and unchanged FALSE on failure |
# | ||||||||
public
|
getGroups(CriteriaElement $criteria = null, bool $id_as_key = false): array
retrieve groups from the database
retrieve groups from the database Parameters
Returnsarray of {@link XoopsGroup} objects |
# | ||||||||
public
|
getUsers(CriteriaElement $criteria = null, bool $id_as_key = false): array
retrieve users from the database
retrieve users from the database Parameters
Returnsarray of {@link XoopsUser} objects |
# | ||||||||
public
|
getGroupList(CriteriaElement $criteria = null): array
get a list of groupnames and their IDs
get a list of groupnames and their IDs Parameters
Returnsassociative array of group-IDs and names |
# | ||||||||
public
|
getUserList(CriteriaElement $criteria = null): array
get a list of usernames and their IDs
get a list of usernames and their IDs Parameters
Returnsassociative array of user-IDs and names |
# | ||||||||
public
|
addUserToGroup(int $group_id, int $user_id): XoopsMembership
add a user to a group
add a user to a group Parameters
ReturnsXoopsMembership |
# | ||||||||
public
|
removeUsersFromGroup(int $group_id, array $user_ids = []): bool
remove a list of users from a group
remove a list of users from a group Parameters
Returnssuccess? |
# | ||||||||
public
|
getUsersByGroup(int $group_id, bool $asobject = false, int $limit = 0, int $start = 0): array
get a list of users belonging to a group
get a list of users belonging to a group Parameters
ReturnsArray of {@link XoopsUser} objects (if $asobject is TRUE) or of associative arrays matching the record structure in the database. |
# | ||||||||
public
|
getGroupsByUser(int $user_id, bool $asobject = false): array
get a list of groups that a user is member of
get a list of groups that a user is member of Parameters
Returnsarray of objects or arrays |
# | ||||||||
public
|
loginUser(string $uname, string $pwd): XoopsUser|false
log in a user
log in a user Parameters
Returnslogged in XoopsUser, FALSE if failed to log in |
# | ||||||||
public
|
getColumnCharacterLength(string $table, string $column): int|null
Get maximum character length for a table column
Get maximum character length for a table column Parameters
Returnsmax length or null on error |
# | ||||||||
public
|
getUserCount(CriteriaElement $criteria = null): int
count users matching certain conditions
count users matching certain conditions Parameters
|
# | ||||||||
public
|
getUserCountByGroup(int $group_id): int
count users belonging to a group
count users belonging to a group Parameters
|
# | ||||||||
public
|
updateUserByField(XoopsUser $user, string $fieldName, string $fieldValue): bool
updates a single field in a users record
updates a single field in a users record Parameters
ReturnsTRUE if success or unchanged, FALSE on failure |
# | ||||||||
public
|
updateUsersByField(string $fieldName, string $fieldValue, CriteriaElement $criteria = null): bool
updates a single field in a users record
updates a single field in a users record Parameters
ReturnsTRUE if success or unchanged, FALSE on failure |
# | ||||||||
public
|
activateUser(XoopsUser $user): mixed
activate a user
activate a user Parameters
Returnssuccessful? false on failure |
# | ||||||||
public
|
getUsersByGroupLink(
array $groups,
CriteriaElement $criteria = null,
bool $asobject = false,
bool $id_as_key = false,
): array
Get a list of users belonging to certain groups and matching criteria
Temporary solution
Get a list of users belonging to certain groups and matching criteria Temporary solution Parameters
ReturnsArray of {@link XoopsUser} objects (if $asobject is TRUE) or of associative arrays matching the record structure in the database. |
# | ||||||||
public
|
getUserCountByGroupLink(array $groups, CriteriaElement $criteria = null): int
Get count of users belonging to certain groups and matching criteria
Temporary solution
Get count of users belonging to certain groups and matching criteria Temporary solution Parameters
Returnscount of users |
# |
Properties | |||
---|---|---|---|
protected
|
|
$groupHandler
holds reference to group handler(DAO) class
holds reference to group handler(DAO) class |
# |
protected
|
|
$userHandler
holds reference to user handler(DAO) class
holds reference to user handler(DAO) class |
# |
protected
|
|
$membershipHandler
holds reference to membership handler(DAO) class
holds reference to membership handler(DAO) class |
# |
protected
|
|
$membersWorkingList = []
holds temporary user objects
holds temporary user objects |
# |