Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

BaseGroup Class Reference
[Base Objects]

Inheritance diagram for BaseGroup:

MyObject BaseObject MyModule BaseModule List of all members.

Detailed Description

BaseGroup is a module that simplifies groups of users.

A class that handles creating, editing, deleting of groups. Also handles things like adding/removing members, and the various permissions associated with that. It also has pages for joining and leaving.

Definition at line 10 of file base-group.inc.php.

Public Member Functions

 __construct ($data=null, $table= 'groups', $joinerTable= 'users_to_groups', $joinedObject= 'User')
 our constructor.
 getPagesXml ()
 add join / leave pages
 isMember ($id)
 this function tells us if we're a member of the group or not.
 addMember ($id)
 this function adds a member to the group
 removeMember ($id)
 removes a member from the group
 getGroupMemberIds ()
 get the id's of the group members
 canJoin ()
 tells us if we can join the group.
 canLeave ()
 tells us if we can leave the group.
 initJoinPage ()
 initializes our join page.
 drawJoinPage ()
 adds us to the group and draws a status message.
 initLeavePage ()
 initializes our leave page.
 drawLeavePage ()
 removes us from the group, draws status, etc.
 getName ($link=false)
 gets us a name to draw.
 editFormAddFields ($form)
 add in our name / description fields to edit.
 getCreateTableSql ()
 hers is our table creation sql.
 drawCreateTablePage ()
 see BaseModule.
 runCreateTableSql ()
 see BaseModule.
 getJoinerTableSql ()
 here is our joiner table creation sql.
 getCreateFieldsArray ()
 adds in our name and description fields...
 getJoinerFieldsArray ()
 get an array of fields for our joiner table.
 getJoinerIndexesArray ()
 get an array of keys for the joiner table.
 getRssItem ()
 get our rss action for this group! see BaseObject
 getPublicData ()
 get our data for this group! see BaseObject

Public Attributes

 $joinerTable
 the name of our joiner table in teh db.
 $joinedObject
 the class name of our joined object
 $members = array()
 an array of our members

Protected Member Functions

 editPagePostSuccess ($form)
 post processing, add creator as member


Member Function Documentation

BaseGroup::__construct data = null,
table = 'groups',
joinerTable = 'users_to_groups',
joinedObject = 'User'
 

our constructor.

create the group!

Parameters:
$data see BaseObject
$table see BaseObject
$joinerTable the table to join object to our group with.
$joinedObject the sring name of the object joined

Definition at line 35 of file base-group.inc.php.

BaseGroup::addMember id  ) 
 

this function adds a member to the group

Parameters:
$id the id of the member to add.

Definition at line 81 of file base-group.inc.php.

References dbExecute(), and removeMember().

Referenced by drawJoinPage(), and editPagePostSuccess().

BaseGroup::canJoin  ) 
 

tells us if we can join the group.

used in initJoinPage()

Returns:
boolean if we can join or not.

Definition at line 140 of file base-group.inc.php.

References isMember().

Referenced by initJoinPage().

BaseGroup::canLeave  ) 
 

tells us if we can leave the group.

used in initLeavePage()

Returns:
boolean if we can leave or not.

Definition at line 152 of file base-group.inc.php.

References isMember().

Referenced by initLeavePage().

BaseGroup::drawCreateTablePage  ) 
 

see BaseModule.

adding in our joiner code

Reimplemented from BaseModule.

Definition at line 267 of file base-group.inc.php.

BaseGroup::drawJoinPage  ) 
 

adds us to the group and draws a status message.

Definition at line 176 of file base-group.inc.php.

References addMember(), and getName().

BaseGroup::drawLeavePage  ) 
 

removes us from the group, draws status, etc.

Definition at line 202 of file base-group.inc.php.

References getName(), and removeMember().

BaseGroup::editFormAddFields form  ) 
 

add in our name / description fields to edit.

see BaseObject

Reimplemented from BaseObject.

Definition at line 222 of file base-group.inc.php.

BaseGroup::editPagePostSuccess form  )  [protected]
 

post processing, add creator as member

Reimplemented from BaseObject.

Definition at line 242 of file base-group.inc.php.

References addMember().

BaseGroup::getCreateFieldsArray  ) 
 

adds in our name and description fields...

see BaseObject

Reimplemented from BaseObject.

Definition at line 301 of file base-group.inc.php.

BaseGroup::getCreateTableSql  ) 
 

hers is our table creation sql.

extended to also create joiner table. you wont need to override unless you are adding tables

Returns:
the sql string ready to execute.

Reimplemented from BaseObject.

Definition at line 257 of file base-group.inc.php.

BaseGroup::getGroupMemberIds  ) 
 

get the id's of the group members

Returns:
an array of ids

Definition at line 121 of file base-group.inc.php.

References dbFetchAssoc(), and dbQuery().

BaseGroup::getJoinerFieldsArray  ) 
 

get an array of fields for our joiner table.

extend this to add fields to the table.

Returns:
the array of field name to create syntax

Definition at line 316 of file base-group.inc.php.

BaseGroup::getJoinerIndexesArray  ) 
 

get an array of keys for the joiner table.

extend this to add indexes to the table.

Returns:
an array of key name to create syntax

Definition at line 330 of file base-group.inc.php.

BaseGroup::getJoinerTableSql  ) 
 

here is our joiner table creation sql.

you probably wont need to override.

Returns:
sql ready to execute

Definition at line 289 of file base-group.inc.php.

BaseGroup::getName link = false  ) 
 

gets us a name to draw.

Definition at line 214 of file base-group.inc.php.

Referenced by drawJoinPage(), drawLeavePage(), initJoinPage(), and initLeavePage().

BaseGroup::getPagesXml  ) 
 

add join / leave pages

these are two pages used to let users join or leave our group.

Reimplemented from BaseObject.

Definition at line 52 of file base-group.inc.php.

BaseGroup::getPublicData  ) 
 

get our data for this group! see BaseObject

Reimplemented from BaseObject.

Definition at line 354 of file base-group.inc.php.

BaseGroup::getRssItem  ) 
 

get our rss action for this group! see BaseObject

Reimplemented from BaseObject.

Definition at line 341 of file base-group.inc.php.

BaseGroup::initJoinPage  ) 
 

initializes our join page.

checks to see if we can join, asserts login, etc.

Definition at line 162 of file base-group.inc.php.

References BaseModule::assertLogin(), canJoin(), getName(), and BaseModule::params().

BaseGroup::initLeavePage  ) 
 

initializes our leave page.

checks if we can, asserts login, etc

Definition at line 188 of file base-group.inc.php.

References BaseModule::assertLogin(), canLeave(), getName(), and BaseModule::params().

BaseGroup::isMember id  ) 
 

this function tells us if we're a member of the group or not.

it checks the members array.

Definition at line 71 of file base-group.inc.php.

Referenced by canJoin(), and canLeave().

BaseGroup::removeMember id  ) 
 

removes a member from the group

Parameters:
$id the id of the member to remove

Definition at line 103 of file base-group.inc.php.

References dbExecute().

Referenced by addMember(), and drawLeavePage().

BaseGroup::runCreateTableSql  ) 
 

see BaseModule.

adding in our joiner code

Reimplemented from BaseModule.

Definition at line 277 of file base-group.inc.php.

References dbExecute().


Member Data Documentation

BaseGroup::$joinedObject
 

the class name of our joined object

Definition at line 20 of file base-group.inc.php.

BaseGroup::$joinerTable
 

the name of our joiner table in teh db.

Definition at line 15 of file base-group.inc.php.

BaseGroup::$members = array()
 

an array of our members

Definition at line 25 of file base-group.inc.php.


The documentation for this class was generated from the following file:
Generated on Fri Oct 27 12:26:41 2006 for BaseJumper by doxygen 1.3.9.1