go-basic
[ class tree: go-basic ] [ index: go-basic ] [ all elements ]

Class: GO_GROUPS

Source Location: /classes/base/groups.class.inc.php

Class Overview

base_db
   |
   --db
      |
      --GO_GROUPS

This class is used to manage user groups


Author(s):

Version:

  • $Id: groups.class.inc.php 1225 2008-10-25 12:30:46Z mschering $

Copyright:

  • Copyright Intermesh

Methods


Inherited Variables

Inherited Methods

Class: db

db::affected_rows()
Gets the number of affected rows in a previous MySQL operatio
db::connect()
Connnects to the database
db::escape()
Escapes a value to make it safe to send to MySQL
db::found_rows()
Returns the number of rows found when you have used SELECT SQL_CALC_FOUND_ROWS
db::free()
Frees the memory associated with a result
db::insert_id()
Returns the auto generated id used in the last query
db::next_record()
Walk the result set from a select query
db::num_fields()
Get the number of fields in a result
db::num_rows()
Return the number of rows found in the last select statement
db::query()
Queries the database
db::set_error()
Sets the error and errno property
db::__wakeup()
When this object is stored in a session it must reconnect when created by the session again.

Class: base_db

base_db::__construct()
Constructor a config object with db_host, db_pass, db_user and db_name may be passed so it can connect to a different database then the default.
base_db::affected_rows()
Gets the number of affected rows in a previous MySQL operatio
base_db::connect()
Connnects to the database
base_db::escape()
Escapes a value to make it safe to send to MySQL
base_db::f()
Fetch a single field from a result record
base_db::found_rows()
Returns the number of rows found when you have used SELECT SQL_CALC_FOUND_ROWS
base_db::free()
Frees the memory associated with a result
base_db::halt()
Halts when an error occurs
base_db::insert_id()
Returns the auto generated id used in the last query
base_db::insert_row()
Inserts a row in a table
base_db::lock()
Lock a table
base_db::nextid()
Get a next unique ID for a table. Used instead of auto increment so that we have better support for different database backends.
base_db::next_record()
Walk the reseult set from a select query
base_db::num_fields()
Get the number of fields in a result
base_db::num_rows()
Return the number of rows found in the last select statement
base_db::p()
Print a single field from a result record.
base_db::query()
Queries the database
base_db::replace_row()
Replaces a row in a table
base_db::set_config()
Set's the connection parameters. A config object with db_host, db_pass, db_user and db_name may be passed so it can connect to a different database then the default.
base_db::set_error()
Sets the error and errno property
base_db::set_parameters()
Set the connection parameters manually
base_db::unlock()
Unlock tables
base_db::update_row()
Updates a row from a table

Class Details

[line 28]
This class is used to manage user groups

Tags:

author:  Merijn Schering <mschering@intermesh.nl>
version:  $Id: groups.class.inc.php 1225 2008-10-25 12:30:46Z mschering $
copyright:  Copyright Intermesh
since:  Group-Office 2.05
uses:  base_groups


[ Top ]


Class Methods


constructor __construct [line 36]

void __construct( )

Constructor. Calls parent class base_groups constructor

Tags:

access:  public
Overrides base_db::__construct() (Constructor a config object with db_host, db_pass, db_user and db_name may be passed so it can connect to a different database then the default.)
[ Top ]

method add_group [line 177]

int add_group( int $user_id, string $name)

Add's a group

Tags:

return:  The new group ID or false;
access:  public

Parameters:

int   $user_id   The owner user ID
string   $name   The name of the new group

[ Top ]

method add_user_to_group [line 95]

bool add_user_to_group( int $user_id, int $group_id)

Add's a user to a group

Tags:

return:  True on success
access:  public

Parameters:

int   $user_id   The user ID to add
int   $group_id   The group ID to add the user to

[ Top ]

method clear_group [line 82]

bool clear_group( int $group_id)

Removes all go_users from a group

Tags:

return:  True on success
access:  public

Parameters:

int   $group_id   The group ID to reset

[ Top ]

method delete_group [line 62]

bool delete_group( int $group_id)

Delete's a group

Tags:

return:  True on success
access:  public

Parameters:

int   $group_id   The group ID to delete

[ Top ]

method delete_user_from_group [line 114]

bool delete_user_from_group( int $user_id, int $group_id)

Delete's a user to a group

Tags:

return:  True on success
access:  public

Parameters:

int   $user_id   The user ID to delete
int   $group_id   The group ID to remove the user from

[ Top ]

method get_group [line 127]

mixed get_group( int $group_id)

Get a group's properties in an array

Tags:

return:  Array with properties or false
access:  public

Parameters:

int   $group_id   The group ID to query

[ Top ]

method get_groups [line 294]

int get_groups( [ $user_id = 0], [ $start = 0], [ $offset = 0], [ $sort = "name"], [ $direction = "ASC"])

Get's all go_groups. If a user ID is specified it returns only the go_groups that user is a member of.

Tags:

return:  Number of go_groups
access:  public

Parameters:

   $user_id  
   $start  
   $offset  
   $sort  
   $direction  

[ Top ]

method get_group_by_name [line 157]

mixed get_group_by_name( $name, int $group_id)

Get a group's properties in an array

Tags:

return:  Array with properties or false
access:  public

Parameters:

int   $group_id   The group ID to query
   $name  

[ Top ]

method get_users_in_group [line 239]

int get_users_in_group( int $group_id, [ $start = 0], [ $offset = 0], [string $sort = "name"], [string $direction = "ASC"])

Get's all members of a group

Tags:

return:  Number of go_users in the group
access:  public

Parameters:

int   $group_id   The group
string   $sort   The field to sort on
string   $direction   The sort direction (ASC/DESC)
   $start  
   $offset  

[ Top ]

method groupnames_to_ids [line 41]

void groupnames_to_ids( $groupnames)

Parameters:

   $groupnames  

[ Top ]

method is_in_group [line 216]

bool is_in_group( int $user_id, int $group_id)

Check's if a user is a member of a group

Tags:

access:  public

Parameters:

int   $user_id   The user ID
int   $group_id   The group ID

[ Top ]

method search [line 350]

int search( string $query, string $field, int $user_id, [int $start = 0], [int $offset = 0])

Search for a visible user for another user.

Tags:

return:  The number of records returned
access:  public

Parameters:

string   $query   The keyword to search on
string   $field   The database field to search on
int   $user_id   The user_id to search for (Permissions)
int   $start   The first record to return
int   $offset   The number of records to return

[ Top ]

method update_group [line 145]

mixed update_group( int $group_id, string $name)

Set the name of a group

Tags:

return:  Array with properties or false
access:  public

Parameters:

string   $name   The new name of the group
int   $group_id   The group ID to query

[ Top ]


Documentation generated on Thu, 30 Oct 2008 14:13:32 +0100 by phpDocumentor 1.4.0