Class abook_database

Description

Address book in a database backend

Backend for personal/shared address book stored in a database, accessed using the DB-classes in PEAR.

IMPORTANT: The PEAR modules must be in the include path for this class to work.

An array with the following elements must be passed to the class constructor (elements marked ? are optional):

   dsn       => database DNS (see PEAR for syntax)
   table     => table to store addresses in (must exist)
   owner     => current user (owner of address data)
 ? name      => name of address book
 ? writeable => set writeable flag (true/false)
 ? listing   => enable/disable listing
The table used should have the following columns: owner, nickname, firstname, lastname, email, label The pair (owner,nickname) should be unique (primary key).

NOTE. This class should not be used directly. Use the "AddressBook" class instead.

Located in /functions/abook_database.php (line 53)

addressbook_backend
   |
   --abook_database
Variable Summary
string $bname
string $btype
resource $dbh
string $dsn
bool $listing
string $owner
string $table
bool $writeable
Method Summary
abook_database abook_database (array $param)
bool add (array $userdata)
void close ()
array list_addr ()
array lookup (string $alias)
bool modify (string $alias, array $userdata)
bool open ([bool $new = false])
bool remove (string $alias)
array search (string $expr)
Variables
string $bname = 'database' (line 63)

Backend name


Redefinition of:
addressbook_backend::$bname
string $btype = 'local' (line 58)

Backend type


Redefinition of:
addressbook_backend::$btype
resource $dbh = false (line 86)

Database Handle

string $dsn = '' (line 69)

Data Source Name (connection description)

bool $listing = true (line 96)

Enable/disable address book listing

string $owner = '' (line 81)

Owner name

Limits list of database entries visible to end user

string $table = '' (line 74)

Table that stores addresses

bool $writeable = true (line 91)

Enable/disable writing into address book


Redefinition of:
addressbook_backend::$writeable

Inherited Variables

Inherited from addressbook_backend

addressbook_backend::$bnum
addressbook_backend::$error
addressbook_backend::$sname
Methods
Constructor abook_database (line 104)

Constructor

abook_database abook_database (array $param)
  • array $param: address book backend options
add (line 326)

Add address

bool add (array $userdata)
  • array $userdata: added data

Redefinition of:
addressbook_backend::add()
close (line 177)

Close the file and forget the filehandle

void close ()
list_addr (line 287)

List all addresses

  • return: search results
array list_addr ()

Redefinition of:
addressbook_backend::list_addr()
lookup (line 249)

Lookup alias

  • return: search results
array lookup (string $alias)
  • string $alias: alias

Redefinition of:
addressbook_backend::lookup()
modify (line 407)

Modify address

bool modify (string $alias, array $userdata)
  • string $alias: modified alias
  • array $userdata: new data

Redefinition of:
addressbook_backend::modify()
open (line 143)

Open the database.

bool open ([bool $new = false])
  • bool $new: new connection if it is true
remove (line 369)

Delete address

bool remove (string $alias)
  • string $alias: alias that has to be deleted

Redefinition of:
addressbook_backend::remove()
search (line 189)

Search the database

  • return: search results
array search (string $expr)
  • string $expr: search expression

Redefinition of:
addressbook_backend::search()

Inherited Methods

Inherited From addressbook_backend

addressbook_backend::add()
addressbook_backend::list_addr()
addressbook_backend::lookup()
addressbook_backend::modify()
addressbook_backend::remove()
addressbook_backend::search()
addressbook_backend::set_error()

Documentation generated on Sat, 07 Oct 2006 16:29:33 +0300 by phpDocumentor 1.3.0RC6