Class TableMembers
- TableAccess
- TableMembers
License: GNU General Public License v2.0 only **********************************************************************************************
Brief:
Handle memberships of roles and manage it in the database table adm_members
The class search in the database table @b adm_members for role memberships of users. It has easy methods to start or stop a membership.
Class: TableMembers
Code:
// start membership without read data before $membership = new TableMembers($gDb); $membership->startMembership($roleId, $userId);
// read membership data and then stop membership $membership = new TableMembers($gDb); $membership->readDataByColumns(array('mem_rol_id' => $roleId, 'mem_usr_id' => $userId)); $membership->stopMembership(); @endcode
Par: Examples
Located at tablemembers.php
Methods summary
public
|
#
__construct(
Constructor that will create an object of a recordset of the table adm_members. If the id is set than the specific membership will be loaded. |
public
boolean
|
#
deleteMembership( integer $roleId = 0, integer $userId = 0 )
Deletes a membership for the assigned role and user. In opposite to removeMembership this method will delete the entry and you can't see any history assignment. If the user is the current user then initiate a refresh of his role cache. |
public
boolean
|
#
save( boolean $updateFingerPrint = true )
Save all changed columns of the recordset in table of database. Therefore the class remembers if it's a new record or if only an update is necessary. The update statement will only update the changed columns. If the table has columns for creator or editor than these column with their timestamp will be updated. |
public
boolean
|
#
startMembership( integer $roleId = 0, integer $userId = 0, boolean $leader = null )
Starts a membership for the assigned role and user from now until 31.12.9999. An existing membership will be extended if necessary. If the user is the current user then initiate a refresh of his role cache. |
public
boolean
|
#
stopMembership( integer $roleId = 0, integer $userId = 0 )
Stops a membership for the assigned role and user from now until 31.12.9999. If the user is the current user then initiate a refresh of his role cache. If the last membership of a administrator role should be stopped then throw an exception. |
Methods inherited from TableAccess
__sleep()
,
clear()
,
connectAdditionalTable()
,
countAllRecords()
,
delete()
,
getValue()
,
hasColumnsValueChanged()
,
isNewRecord()
,
readData()
,
readDataByColumns()
,
readDataById()
,
setArray()
,
setDatabase()
,
setValue()
Properties summary
Properties inherited from TableAccess
$additionalTables
,
$columnPrefix
,
$columnsInfos
,
$columnsValueChanged
,
$db
,
$dbColumns
,
$keyColumnName
,
$new_record
,
$tableName