Welcompose
[ class tree: Welcompose ] [ index: Welcompose ] [ all elements ]

Class: User_Group

Source Location: /user_classes/group.class.php

Class Overview




Variables

Methods



Class Details

[line 39]


[ Top ]


Class Variables

static $instance =  null

[line 46]

Singleton



Tags:

access:  public

Type:   object


[ Top ]

$base =  null

[line 53]

Reference to base class



Tags:

access:  public

Type:   object


[ Top ]



Class Methods


constructor __construct [line 60]

User_Group __construct( )

Start instance of base class, load configuration and establish database connection. Please don't call the constructor direcly, use the singleton pattern instead.



Tags:

access:  public


[ Top ]

method addGroup [line 86]

int addGroup( array $sqlData)

Adds group to the group table. Takes a field=>value array with the group data as first argument. Returns insert id.



Tags:

return:  Group id
throws:  User_GroupException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method addTargetGroup [line 120]

int addTargetGroup( array $sqlData)

Adds group to the target project group table. Takes a field=>value array with the group data as first argument. Returns insert id.



Tags:

return:  Group id
throws:  User_GroupException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method deleteGroup [line 190]

int deleteGroup( int $id)

Removes group from the user group table. Takes the user group id as first argument. Returns amount of affected rows.



Tags:

return:  Amount of affected rows
throws:  User_GroupException
access:  public


Parameters:

int   $id   Group id

[ Top ]

method groupBelongsToCurrentProject [line 705]

bool groupBelongsToCurrentProject( int $group)

Tests whether given group belongs to current project. Takes the group id as first argument. Returns boolean true or false.



Tags:

throws:  User_GroupException
access:  public


Parameters:

int   $group   Group id

[ Top ]

method groupBelongsToCurrentUser [line 750]

bool groupBelongsToCurrentUser( int $group)

Tests whether group belongs to current user or not. Takes the group id as first argument. Returns bool.



Tags:

throws:  User_GroupException
access:  public


Parameters:

int   $group   Group id

[ Top ]

method groupBelongsToSomeUser [line 783]

bool groupBelongsToSomeUser( int $group)

Tests whether given group belongs to one user at least. Takes the group id as first argument. Returns boolean true or false.



Tags:

throws:  User_GroupException
access:  public


Parameters:

int   $group   Group id

[ Top ]

method mapGroupToRights [line 506]

bool mapGroupToRights( int $group, [array $rights = array()])

Maps groups to one or more rights. Takes group id as first argument, a list of right ids as second argument. Returns boolean true.

If the list of right ids is omitted, the group will be detached from all groups.




Tags:

throws:  User_GroupException
access:  public


Parameters:

int   $group   group id
array   $rights   Right ids

[ Top ]

method mapTargetGroupToRights [line 587]

bool mapTargetGroupToRights( int $group, int $project, [array $rights = array()])

Maps target groups to one or more rights. Takes group id as first argument, the project id as second argument and a list of right ids as third argument.

Returns bool.

If the list of right ids is omitted, the group will be detached from all groups.




Tags:

throws:  User_GroupException
access:  public


Parameters:

int   $group   Group id
int   $project   Project id
array   $rights   Right ids

[ Top ]

method selectGroup [line 233]

array selectGroup( int $id)

Selects group. Takes the group id as first argument.

Returns array.




Tags:

throws:  User_GroupException
access:  public


Parameters:

int   $id   Group id

[ Top ]

method selectGroups [line 303]

array selectGroups( [array $params = array()])

Method to select one or more user groups. Takes key=>value array with select params as first argument. Returns array.

List of supported params:

  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  User_GroupException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method selectGroupToRightsMap [line 657]

array selectGroupToRightsMap( int $group)

Selects links between the given group and their associated rights. Takes the group id as first argument. Returns array.



Tags:

throws:  User_GroupException
access:  public


Parameters:

int   $group   Group id

[ Top ]

method selectTargetGroups [line 405]

array selectTargetGroups( [array $params = array()])

Method to select one or more user groups. Takes key=>value array with select params as first argument. Returns array.

List of supported params:

  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  User_GroupException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method testForUniqueName [line 829]

bool testForUniqueName( string $name, [int $id = null])

Tests given group name for uniqueness. Takes the group name as

first argument and an optional group id as second argument. If the group id is given, this group won't be considered when checking for uniqueness (useful for updates). Returns boolean true if group name is unique.




Tags:

throws:  User_GroupException
access:  public


Parameters:

string   $name   Group name
int   $id   Group id

[ Top ]

method updateGroup [line 148]

int updateGroup( int $id, array $sqlData)

Updates group. Takes the group id as first argument, a field=>value array with the new row data as second argument. Returns amount of affected rows.



Tags:

return:  Affected rows
throws:  User_GroupException
access:  public


Parameters:

int   $id   Group id
array   $sqlData   Row data

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:50 +0100 by phpDocumentor 1.4.3