Create a unique key for sorting contacts
void
compose_contact_key
( $contact, $sort_col)
Compose a valid display name from the given structured contact data
string
compose_display_name
(array $contact, [bool $full_email = false])
-
array
$contact: Hash array with contact data as key-value pairs
-
bool
$full_email: Don't attempt to extract components from the email address
Compose the name to display in the contacts list for the given contact record.
This respects the settings parameter how to list conacts.
string
compose_list_name
(array $contact)
-
array
$contact: Hash array with contact data as key-value pairs
Normalize the given string for fulltext search.
Currently only optimized for Latin-1 characters; to be extended
string
normalize_string
(string $str)
-
string
$str: Input string (UTF-8)
Add the given contact records the a certain group
int
add_to_group
(string $group_id, array|string $ids)
-
string
$group_id: Group identifier
-
array|string
$ids: List of contact identifiers to be added
Redefined in descendants as:
Close connection to source
Called on script shutdown
void
close
()
Redefined in descendants as:
Compare search value with contact data
bool
compare_search_value
(string $colname, string|array $value, string $search, int $mode)
-
string
$colname: Data name
-
string|array
$value: Data value
-
string
$search: Search value
-
int
$mode: Search mode
Count number of available contacts in database
Redefined in descendants as:
Create a contact group with the given name
mixed
create_group
(string $name)
-
string
$name: The group name
Redefined in descendants as:
Mark one or more contact records as deleted
void
delete
(array $ids, [bool $force = true])
-
array
$ids: Record identifiers
-
bool
$force: Remove records irreversible (see self::undelete)
Redefined in descendants as:
Mark all records in database as deleted
void
delete_all
()
Redefined in descendants as:
Delete the given group and all linked group members
boolean
delete_group
(string $gid)
-
string
$gid: Group identifier
Redefined in descendants as:
Utility function to return all values of a certain data column either as flat list or grouped by subtype
array
get_col_values
(string $col, array $data, [boolean $flat = false])
-
string
$col: Col name
-
array
$data: Record data array as used for saving
-
boolean
$flat: True to return one array with all values, False for hash array with values grouped by type
Returns the last error occured (e.g. when updating/inserting failed)
array
get_error
()
Get group properties such as name and email address(es)
array
get_group
(string $group_id)
-
string
$group_id: Group identifier
Redefined in descendants as:
Returns addressbook name (e.g. for addressbooks listing)
void
get_name
()
Redefined in descendants as:
Get a specific contact record
mixed
get_record
(mixed $id, [boolean $assoc = false])
-
mixed
$id: record identifier(s)
-
boolean
$assoc: True to return record as associative array, otherwise a result set is returned
Redefined in descendants as:
Get group assignments of a specific contact record
array
get_record_groups
(mixed $id)
-
mixed
$id: Record identifier
Redefined in descendants as:
Return the last result set
Redefined in descendants as:
Getter for saved search properties
mixed
get_search_set
()
Redefined in descendants as:
Create a new contact record
mixed
insert
(array $save_data, [boolean $check = false])
-
array
$save_data: Assoziative array with save data Keys: Field name with optional section in the form FIELD:SECTION Values: Field value. Can be either a string or an array of strings for multiple values
-
boolean
$check: True to check for duplicates first
Redefined in descendants as:
Create new contact records for every item in the record set
List all active contact groups of this source
array
list_groups
([string $search = null], [int $mode = 0])
-
string
$search: Optional search string to match group name
-
int
$mode: Matching mode:
- - partial (*abc*),
- - strict (=),
- - prefix (abc*)
Redefined in descendants as:
List the current set of contact records
array
list_records
([array $cols = null], [int $subset = 0])
-
array
$cols: List of cols to show
-
int
$subset: Only return this number of records, use negative values for tail
Redefined in descendants as:
Refresh saved search set after data has changed
mixed
refresh_search
()
Remove the given contact records from a certain group
int
remove_from_group
(string $group_id, array|string $ids)
-
string
$group_id: Group identifier
-
array|string
$ids: List of contact identifiers to be removed
Redefined in descendants as:
Rename a specific contact group
boolean
rename_group
(string $gid, string $newname, string &$newid)
-
string
$gid: Group identifier
-
string
$newname: New name to set for this group
-
string
&$newid: New group identifier (if changed, otherwise don't set)
Redefined in descendants as:
Reset saved results and search parameters
void
reset
()
Redefined in descendants as:
Search records
object rcube_result_set
search
(
array $fields,
string $value, [
int $mode =
0], [
boolean $select =
true], [
boolean $nocount =
false], [
array $required =
array()])
-
array
$fields: List of fields to search in
-
string
$value: Search value
-
int
$mode: Matching mode:
- - partial (*abc*),
- - strict (=),
- - prefix (abc*)
-
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
Redefined in descendants as:
Setter for errors for internal use
void
set_error
(int $type, string $message)
-
int
$type: Error type (one of this class' error constants)
-
string
$message: Error message (name of a text label)
Setter for the current group
(empty, has to be re-implemented by extending class)
void
set_group
( $gid)
Redefined in descendants as:
Set internal list page
void
set_page
(number $page)
-
number
$page: Page number to list
Redefined in descendants as:
Set internal page size
void
set_pagesize
(number $size)
-
number
$size: Number of messages to display on one page
Redefined in descendants as:
Save a search string for future listings
void
set_search_set
(mixed $filter)
-
mixed
$filter: Search params to use in listing method, obtained by get_search_set()
Redefined in descendants as:
Set internal sort settings
void
set_sort_order
(string $sort_col, [string $sort_order = null])
-
string
$sort_col: Sort column
-
string
$sort_order: Sort order
Redefined in descendants as:
Unmark delete flag on contact record(s)
void
undelete
(array $ids)
-
array
$ids: Record identifiers
Redefined in descendants as:
Update a specific contact record
boolean
update
(mixed $id, array $save_cols)
-
mixed
$id: Record identifier
-
array
$save_cols: Assoziative array with save data Keys: Field name with optional section in the form FIELD:SECTION Values: Field value. Can be either a string or an array of strings for multiple values
Redefined in descendants as:
Check the given data before saving.
If input isn't valid, the message to display can be fetched using get_error()
boolean
validate
(array &$save_data, [boolean $autofix = false])
-
array
&$save_data: Assoziative array with data to save
-
boolean
$autofix: Attempt to fix/complete record automatically
Redefined in descendants as: