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

Class: User_Right

Source Location: /user_classes/right.class.php

Class Overview




Variables

Methods



Class Details

[line 38]


[ Top ]


Class Variables

static $instance =  null

[line 45]

Singleton



Tags:

access:  public

Type:   object


[ Top ]

$base =  null

[line 52]

Reference to base class



Tags:

access:  public

Type:   object


[ Top ]



Class Methods


constructor __construct [line 59]

User_Right __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 addRight [line 85]

int addRight( array $sqlData)

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



Tags:

return:  Right id
throws:  User_RightException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method countRights [line 445]

int countRights( [array $params = array()])

Method to count user rights. Takes key=>value array with counting params as first argument. Returns array.

List of supported params:

  • group, int, optional: Group id




Tags:

throws:  User_RightException
access:  public


Parameters:

array   $params   Count params

[ Top ]

method deleteRight [line 162]

int deleteRight( int $id)

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



Tags:

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


Parameters:

int   $id   Right id

[ Top ]

method rightBelongsToCurrentProject [line 570]

bool rightBelongsToCurrentProject( int $right)

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



Tags:

throws:  User_RightException
access:  public


Parameters:

int   $right   Right id

[ Top ]

method rightBelongsToCurrentUser [line 615]

bool rightBelongsToCurrentUser( int $right)

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



Tags:

throws:  User_RightException
access:  public


Parameters:

int   $right   Right id

[ Top ]

method selectRight [line 200]

array selectRight( int $id)

Selects right. Takes the right id as first argument.

Returns array.




Tags:

throws:  User_RightException
access:  public


Parameters:

int   $id   Right id

[ Top ]

method selectRights [line 259]

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

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

List of supported params:

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




Tags:

throws:  User_RightException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method selectTargetRights [line 352]

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

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

List of supported params:

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




Tags:

throws:  User_RightException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method testForUniqueName [line 512]

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

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

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




Tags:

throws:  User_RightException
access:  public


Parameters:

string   $name   Right name
int   $id   Right id

[ Top ]

method updateRight [line 120]

int updateRight( int $id, array $sqlData)

Updates right. Takes the right 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_RightException
access:  public


Parameters:

int   $id   Right id
array   $sqlData   Row data

[ Top ]


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