Class rcube_contacts

Description

Model class for the local address book database

Located in /rcube_contacts.php (line 28)

rcube_addressbook
   |
   --rcube_contacts
Variable Summary
 mixed $coltypes
 mixed $db_groups
 mixed $db_name
 mixed $groups
 mixed $group_id
 mixed $list_page
 mixed $page_size
 mixed $primary_key
 mixed $readonly
 mixed $ready
 mixed $undelete
Method Summary
 rcube_contacts __construct (object Instance $dbconn, integer $user)
 int add_to_group (string $group_id, array $ids)
 mixed create_group (string $name)
 void delete (array $ids, [boolean $force = true])
 void delete_all ()
 boolean delete_group (string $gid)
 void get_name ()
 mixed get_record (mixed $id, [ $assoc = false])
 array get_record_groups (mixed $id)
 mixed get_result ()
 mixed get_search_set ()
 integer|boolean insert (array $save_data, [ $check = false])
 array list_groups ([string $search = null])
 array list_records ([array $cols = null], [int $subset = 0], [boolean $nocount = false])
 int remove_from_group (string $group_id, array $ids)
 boolean rename_group (string $gid, string $newname)
 void reset ()
 object rcube_result_set search (mixed $fields, mixed $value, [boolean $strict = false], [boolean $select = true], [boolean $nocount = false], [array $required = array()])
 void set_group ( $gid)
 void set_search_set (string $filter)
 void undelete (array $ids)
 boolean update (mixed $id, array $save_cols)
 boolean validate (array $save_data)
Variables
mixed $coltypes = array('name', 'firstname', 'surname', 'middlename', 'prefix', 'suffix', 'nickname',
'jobtitle', 'organization', 'department', 'assistant', 'manager',
'gender', 'maidenname', 'spouse', 'email', 'phone', 'address',
'birthday', 'anniversary', 'website', 'im', 'notes', 'photo')
(line 60)
  • access: public

Redefinition of:
rcube_addressbook::$coltypes
mixed $db_groupmembers = 'contactgroupmembers' (line 33)
  • access: protected
mixed $db_groups = 'contactgroups' (line 32)
  • access: protected
mixed $db_name = 'contacts' (line 31)
  • access: protected
mixed $groups = true (line 54)
  • access: public

Redefinition of:
rcube_addressbook::$groups
mixed $group_id = 0 (line 58)
  • access: public

Redefinition of:
rcube_addressbook::$group_id
mixed $list_page = 1 (line 56)
  • access: public

Redefinition of:
rcube_addressbook::$list_page
mixed $page_size = 10 (line 57)
  • access: public

Redefinition of:
rcube_addressbook::$page_size
mixed $primary_key = 'contact_id' (line 52)
  • access: public

Redefinition of:
rcube_addressbook::$primary_key
public properties (mandatory)
mixed $readonly = false (line 53)
  • access: public

Redefinition of:
rcube_addressbook::$readonly
mixed $ready = false (line 59)
  • access: public

Redefinition of:
rcube_addressbook::$ready
mixed $undelete = true (line 55)
  • access: public

Redefinition of:
rcube_addressbook::$undelete

Inherited Variables

Inherited from rcube_addressbook

rcube_addressbook::$error
rcube_addressbook::$searchonly
Methods
Constructor __construct (line 72)

Object constructor

rcube_contacts __construct (object Instance $dbconn, integer $user)
  • object Instance $dbconn: of the rcube_db class
  • integer $user: User-ID
add_to_group (line 816)

Add the given contact records the a certain group

  • return: Number of contacts added
int add_to_group (string $group_id, array $ids)
  • string $group_id: Group identifier
  • array $ids: List of contact identifiers to be added

Redefinition of:
rcube_addressbook::add_to_group()
Add the given contact records the a certain group
count (line 389)

Count number of available contacts in database

  • return: Result object
rcube_result_set count ()

Redefinition of:
rcube_addressbook::count()
Count number of available contacts in database
create_group (line 744)

Create a contact group with the given name

  • return: False on error, array with record props in success
mixed create_group (string $name)
  • string $name: The group name

Redefinition of:
rcube_addressbook::create_group()
Create a contact group with the given name
delete (line 674)

Mark one or more contact records as deleted

void delete (array $ids, [boolean $force = true])
  • array $ids: Record identifiers
  • boolean $force: Remove record(s) irreversible (unsupported)

Redefinition of:
rcube_addressbook::delete()
Mark one or more contact records as deleted
delete_all (line 726)

Remove all records from the database

void delete_all ()

Redefinition of:
rcube_addressbook::delete_all()
Mark all records in database as deleted
delete_group (line 770)

Delete the given group (and all linked group members)

  • return: True on success, false if no data was changed
boolean delete_group (string $gid)
  • string $gid: Group identifier

Redefinition of:
rcube_addressbook::delete_group()
Delete the given group and all linked group members
get_name (line 83)

Returns addressbook name

void get_name ()

Redefinition of:
rcube_addressbook::get_name()
Returns addressbook name (e.g. for addressbooks listing)
get_record (line 446)

Get a specific contact record

  • return: Result object with all record fields or False if not found
mixed get_record (mixed $id, [ $assoc = false])
  • mixed $id: record identifier(s)
  • $assoc

Redefinition of:
rcube_addressbook::get_record()
Get a specific contact record
get_record_groups (line 477)

Get group assignments of a specific contact record

  • return: List of assigned groups as ID=>Name pairs
array get_record_groups (mixed $id)
  • mixed $id: Record identifier

Redefinition of:
rcube_addressbook::get_record_groups()
Get group assignments of a specific contact record
get_result (line 434)

Return the last result set

  • return: Result array or NULL if nothing selected yet
mixed get_result ()

Redefinition of:
rcube_addressbook::get_result()
Return the last result set
get_search_set (line 106)

Getter for saved search properties

  • return: Search properties used by this class
mixed get_search_set ()

Redefinition of:
rcube_addressbook::get_search_set()
Getter for saved search properties
insert (line 526)

Create a new contact record

  • return: The created record ID on success, False on error
integer|boolean insert (array $save_data, [ $check = false])
  • array $save_data: Associative array with save data
  • $check

Redefinition of:
rcube_addressbook::insert()
Create a new contact record
list_groups (line 140)

List all active contact groups of this source

  • return: Indexed list of contact groups, each a hash array
array list_groups ([string $search = null])
  • string $search: Search string to match group name

Redefinition of:
rcube_addressbook::list_groups()
List all active contact groups of this source
list_records (line 174)

List the current set of contact records

  • return: Indexed list of contact records, each a hash array
array list_records ([array $cols = null], [int $subset = 0], [boolean $nocount = false])
  • array $cols: List of cols to show, Null means all
  • int $subset: Only return this number of records, use negative values for tail
  • boolean $nocount: True to skip the count query (select only)

Redefinition of:
rcube_addressbook::list_records()
List the current set of contact records
remove_from_group (line 861)

Remove the given contact records from a certain group

  • return: Number of deleted group members
int remove_from_group (string $group_id, array $ids)
  • string $group_id: Group identifier
  • array $ids: List of contact identifiers to be removed

Redefinition of:
rcube_addressbook::remove_from_group()
Remove the given contact records from a certain group
rename_group (line 793)

Rename a specific contact group

  • return: New name on success, false if no data was changed
boolean rename_group (string $gid, string $newname)
  • string $gid: Group identifier
  • string $newname: New name to set for this group

Redefinition of:
rcube_addressbook::rename_group()
Rename a specific contact group
reset (line 126)

Reset all saved results and search parameters

void reset ()

Redefinition of:
rcube_addressbook::reset()
Reset saved results and search parameters
search (line 255)

Search contacts

  • return: Contact records and 'count' value
object rcube_result_set search (mixed $fields, mixed $value, [boolean $strict = false], [boolean $select = true], [boolean $nocount = false], [array $required = array()])
  • mixed $fields: The field name of array of field names to search in
  • mixed $value: Search value (or array of values when $fields is array)
  • boolean $strict: True for strict (=), False for partial (LIKE) matching
  • boolean $select: True if results are requested, False if count only
  • boolean $nocount: True to skip the count query (select only)
  • array $required: List of fields that cannot be empty

Redefinition of:
rcube_addressbook::search()
Search records
set_group (line 116)

Setter for the current group

(empty, has to be re-implemented by extending class)

void set_group ( $gid)
  • $gid

Redefinition of:
rcube_addressbook::set_group()
Setter for the current group
set_search_set (line 94)

Save a search string for future listings

void set_search_set (string $filter)
  • string $filter: SQL params to use in listing method

Redefinition of:
rcube_addressbook::set_search_set()
Save a search string for future listings
undelete (line 701)

Undelete one or more contact records

void undelete (array $ids)
  • array $ids: Record identifiers

Redefinition of:
rcube_addressbook::undelete()
Unmark delete flag on contact record(s)
update (line 579)

Update a specific contact record

  • return: True on success, False on error
boolean update (mixed $id, array $save_cols)
  • mixed $id: Record identifier
  • array $save_cols: Assoziative array with save data

Redefinition of:
rcube_addressbook::update()
Update a specific contact record
validate (line 505)

Check the given data before saving.

If input not valid, the message to display can be fetched using get_error()

  • return: True if input is valid, False if not.
  • access: public
boolean validate (array $save_data)
  • array $save_data: Assoziative array with data to save

Redefinition of:
rcube_addressbook::validate()
Check the given data before saving.

Inherited Methods

Inherited From rcube_addressbook

 rcube_addressbook::add_to_group()
 rcube_addressbook::close()
 rcube_addressbook::compose_display_name()
 rcube_addressbook::count()
 rcube_addressbook::create_group()
 rcube_addressbook::delete()
 rcube_addressbook::delete_all()
 rcube_addressbook::delete_group()
 rcube_addressbook::get_col_values()
 rcube_addressbook::get_error()
 rcube_addressbook::get_name()
 rcube_addressbook::get_record()
 rcube_addressbook::get_record_groups()
 rcube_addressbook::get_result()
 rcube_addressbook::get_search_set()
 rcube_addressbook::insert()
 rcube_addressbook::insertMultiple()
 rcube_addressbook::list_groups()
 rcube_addressbook::list_records()
 rcube_addressbook::normalize_string()
 rcube_addressbook::refresh_search()
 rcube_addressbook::remove_from_group()
 rcube_addressbook::rename_group()
 rcube_addressbook::reset()
 rcube_addressbook::search()
 rcube_addressbook::set_error()
 rcube_addressbook::set_group()
 rcube_addressbook::set_page()
 rcube_addressbook::set_pagesize()
 rcube_addressbook::set_search_set()
 rcube_addressbook::undelete()
 rcube_addressbook::update()
 rcube_addressbook::validate()
Class Constants

Documentation generated on Tue, 04 Oct 2011 22:55:23 +0200 by phpDocumentor 1.4.3