API - XOOPS 2.5.11 Beta 2
By monxoops.fr
XoopsMemberHandler Class Reference

Public Member Functions

 __construct (XoopsDatabase $db)
 
createGroup ()
 
 createUser ()
 
 getGroup ($id)
 
 getUser ($id)
 
 deleteGroup (XoopsGroup $group)
 
 deleteUser (XoopsUser $user)
 
 insertGroup (XoopsGroup $group)
 
 insertUser (XoopsUser $user, $force=false)
 
 getGroups (CriteriaElement $criteria=null, $id_as_key=false)
 
 getUsers (CriteriaElement $criteria=null, $id_as_key=false)
 
 getGroupList (CriteriaElement $criteria=null)
 
 getUserList (CriteriaElement $criteria=null)
 
 addUserToGroup ($group_id, $user_id)
 
 removeUsersFromGroup ($group_id, $user_ids=array())
 
 getUsersByGroup ($group_id, $asobject=false, $limit=0, $start=0)
 
 getGroupsByUser ($user_id, $asobject=false)
 
 loginUser ($uname, $pwd)
 
 getUserCount (CriteriaElement $criteria=null)
 
 getUserCountByGroup ($group_id)
 
 updateUserByField (XoopsUser $user, $fieldName, $fieldValue)
 
 updateUsersByField ($fieldName, $fieldValue, CriteriaElement $criteria=null)
 
 activateUser (XoopsUser $user)
 
 getUsersByGroupLink ($groups, CriteriaElement $criteria=null, $asobject=false, $id_as_key=false)
 
 getUserCountByGroupLink (array $groups, CriteriaElement $criteria=null)
 

Protected Attributes

 $groupHandler
 
 $userHandler
 
 $membershipHandler
 
 $membersWorkingList = array()
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( XoopsDatabase  $db)

constructor

Parameters
XoopsDatabase|null|$db

Member Function Documentation

◆ activateUser()

activateUser ( XoopsUser  $user)

activate a user

Parameters
XoopsUser$userreference to the XoopsUser object
Returns
mixed successful? false on failure

◆ addUserToGroup()

addUserToGroup (   $group_id,
  $user_id 
)

add a user to a group

Parameters
int$group_idID of the group
int$user_idID of the user
Returns
XoopsMembership XoopsMembership

◆ createGroup()

& createGroup ( )

create a new group

Returns
XoopsGroup XoopsGroup reference to the new group

◆ createUser()

createUser ( )

create a new user

Returns
XoopsUser reference to the new user

◆ deleteGroup()

deleteGroup ( XoopsGroup  $group)

delete a group

Parameters
XoopsGroup$groupreference to the group to delete
Returns
bool FALSE if failed
Here is the call graph for this function:

◆ deleteUser()

deleteUser ( XoopsUser  $user)

delete a user

Parameters
XoopsUser$userreference to the user to delete
Returns
bool FALSE if failed

◆ getGroup()

getGroup (   $id)

retrieve a group

Parameters
int$idID for the group
Returns
XoopsGroup XoopsGroup reference to the group
Here is the caller graph for this function:

◆ getGroupList()

getGroupList ( CriteriaElement  $criteria = null)

get a list of groupnames and their IDs

Parameters
CriteriaElement$criteriaCriteriaElement object
Returns
array associative array of group-IDs and names

◆ getGroups()

getGroups ( CriteriaElement  $criteria = null,
  $id_as_key = false 
)

retrieve groups from the database

Parameters
CriteriaElement$criteriaCriteriaElement
bool$id_as_keyuse the group's ID as key for the array?
Returns
array array of XoopsGroup objects

◆ getGroupsByUser()

getGroupsByUser (   $user_id,
  $asobject = false 
)

get a list of groups that a user is member of

Parameters
int$user_idID of the user
bool$asobjectreturn groups as XoopsGroup objects or arrays?
Returns
array array of objects or arrays
Here is the call graph for this function:

◆ getUser()

getUser (   $id)

retrieve a user

Parameters
int$idID for the user
Returns
XoopsUser reference to the user
Here is the caller graph for this function:

◆ getUserCount()

getUserCount ( CriteriaElement  $criteria = null)

count users matching certain conditions

Parameters
CriteriaElement$criteriaCriteriaElement object
Returns
int

◆ getUserCountByGroup()

getUserCountByGroup (   $group_id)

count users belonging to a group

Parameters
int$group_idID of the group
Returns
int

◆ getUserCountByGroupLink()

getUserCountByGroupLink ( array  $groups,
CriteriaElement  $criteria = null 
)

Get count of users belonging to certain groups and matching criteria Temporary solution

Parameters
array$groupsIDs of groups
CriteriaElement$criteria
Returns
int count of users

◆ getUserList()

getUserList ( CriteriaElement  $criteria = null)

get a list of usernames and their IDs

Parameters
CriteriaElement$criteriaCriteriaElement object
Returns
array associative array of user-IDs and names

◆ getUsers()

getUsers ( CriteriaElement  $criteria = null,
  $id_as_key = false 
)

retrieve users from the database

Parameters
CriteriaElement$criteriaCriteriaElement
bool$id_as_keyuse the group's ID as key for the array?
Returns
array array of XoopsUser objects

◆ getUsersByGroup()

getUsersByGroup (   $group_id,
  $asobject = false,
  $limit = 0,
  $start = 0 
)

get a list of users belonging to a group

Parameters
int$group_idID of the group
bool$asobjectreturn the users as objects?
int$limitnumber of users to return
int$startindex of the first user to return
Returns
array Array of XoopsUser objects (if $asobject is TRUE) or of associative arrays matching the record structure in the database.
Here is the call graph for this function:

◆ getUsersByGroupLink()

getUsersByGroupLink (   $groups,
CriteriaElement  $criteria = null,
  $asobject = false,
  $id_as_key = false 
)

Get a list of users belonging to certain groups and matching criteria Temporary solution

Parameters
array$groupsIDs of groups
CriteriaElement$criteriaCriteriaElement object
bool$asobjectreturn the users as objects?
bool$id_as_keyuse the UID as key for the array if $asobject is TRUE
Returns
array Array of XoopsUser objects (if $asobject is TRUE) or of associative arrays matching the record structure in the database.

◆ insertGroup()

insertGroup ( XoopsGroup  $group)

insert a group into the database

Parameters
XoopsGroup$groupreference to the group to insert
Returns
bool TRUE if already in database and unchanged FALSE on failure

◆ insertUser()

insertUser ( XoopsUser  $user,
  $force = false 
)

insert a user into the database

Parameters
XoopsUser$userreference to the user to insert
bool$force
Returns
bool TRUE if already in database and unchanged FALSE on failure
Here is the caller graph for this function:

◆ loginUser()

loginUser (   $uname,
  $pwd 
)

log in a user

Parameters
string$unameusername as entered in the login form
string$pwdpassword entered in the login form
Returns
XoopsUser|false logged in XoopsUser, FALSE if failed to log in
Here is the call graph for this function:

◆ removeUsersFromGroup()

removeUsersFromGroup (   $group_id,
  $user_ids = array() 
)

remove a list of users from a group

Parameters
int$group_idID of the group
array$user_idsarray of user-IDs
Returns
bool success?

◆ updateUserByField()

updateUserByField ( XoopsUser  $user,
  $fieldName,
  $fieldValue 
)

updates a single field in a users record

Parameters
XoopsUser$userreference to the XoopsUser object
string$fieldNamename of the field to update
string$fieldValueupdated value for the field
Returns
bool TRUE if success or unchanged, FALSE on failure
Here is the call graph for this function:

◆ updateUsersByField()

updateUsersByField (   $fieldName,
  $fieldValue,
CriteriaElement  $criteria = null 
)

updates a single field in a users record

Parameters
string$fieldNamename of the field to update
string$fieldValueupdated value for the field
CriteriaElement$criteriaCriteriaElement object
Returns
bool TRUE if success or unchanged, FALSE on failure

Field Documentation

◆ $groupHandler

$groupHandler
protected

holds reference to group handler(DAO) class @access private

◆ $membershipHandler

$membershipHandler
protected

holds reference to membership handler(DAO) class

◆ $membersWorkingList

$membersWorkingList = array()
protected

holds temporary user objects

◆ $userHandler

$userHandler
protected

holds reference to user handler(DAO) class


The documentation for this class was generated from the following file: