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

Class: GenericDB

Source Location: /lib/db/GenericDB.php

Class Overview


Provides the basic operations and defines the interface of any DB operating class.


Author(s):

Variables

Methods


Child classes:

DBADB
Berkeley DB backend.
GenericMySQLDB
Generic MySQL database class.
SessionDB
Session database backend.

Class Details

[line 31]
Provides the basic operations and defines the interface of any DB operating class.



Tags:

abstract:  


[ Top ]


Class Variables

$cfg =

[line 33]



Tags:

access:  protected

Type:   mixed


[ Top ]

$db =

[line 35]



Tags:

access:  protected

Type:   mixed


[ Top ]

$error =  null

[line 34]



Tags:

access:  protected

Type:   mixed


[ Top ]

$mandatory_options = array()

[line 36]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 42]

GenericDB __construct( cfg $cfg)

Main constructor.



Tags:

access:  public


Overridden in child classes as:

PAPIMySQLDB::__construct()

Parameters:

cfg   $cfg   A *Configurator object with the current configuration.

[ Top ]

method check [line 76]

boolean check( key $key)

Checks if the specified key exists in the database.



Tags:

return:  true if the key exists, false otherwise.
abstract:  
access:  public


Overridden in child classes as:

DBADB::check()
GenericMySQLDB::check()
SessionDB::check()

Parameters:

key   $key   The key to look for.

[ Top ]

method close [line 69]

boolean close( )

Closes the database.



Tags:

return:  true if success, false if error.
abstract:  
access:  public


Overridden in child classes as:

DBADB::close()
GenericMySQLDB::close()
SessionDB::close()

[ Top ]

method configure [line 54]

boolean configure( )

Configure the database handler.



Tags:

return:  true if success, PoAException if error.
access:  protected


[ Top ]

method delete [line 105]

boolean delete( key $key)

Removes the specified key from the database.



Tags:

return:  true if success, false if error.
abstract:  
access:  public


Overridden in child classes as:

DBADB::delete()
GenericMySQLDB::delete()
SessionDB::delete()

Parameters:

key   $key   The key to remove.

[ Top ]

method fetch [line 92]

mixed|boolean fetch( key $key)

Gets the value of the specified key.



Tags:

return:  The value for that key, false if it does not exist.
abstract:  
access:  public


Overridden in child classes as:

DBADB::fetch()
PAPIDBADB::fetch()
AuthorizedDBADB::fetch()
InviteDBADB::fetch()
GenericMySQLDB::fetch()
PAPIMySQLDB::fetch()
SessionDB::fetch()
PAPISessionDB::fetch()

Parameters:

key   $key   The key to look for.

[ Top ]

method fetch_all [line 98]

array fetch_all( )

Gets all the contents stored in the database.



Tags:

return:  An array with all the rows of the database.
abstract:  
access:  public


Overridden in child classes as:

DBADB::fetch_all()
AuthorizedDBADB::fetch_all()
InviteDBADB::fetch_all()
GenericMySQLDB::fetch_all()
SessionDB::fetch_all()

[ Top ]

method open [line 63]

boolean open( )

Opens the database.



Tags:

return:  true if success, false if error.
abstract:  
access:  public


Overridden in child classes as:

DBADB::open()
AuthorizedDBADB::open()
InviteDBADB::open()
GenericMySQLDB::open()
SessionDB::open()

[ Top ]

method replace [line 85]

boolean replace( key $key, value $value)

Replaces the specified key with a new value. If the key does not exist previously, it will be created.



Tags:

return:  true if success, false if error.
abstract:  
access:  public


Overridden in child classes as:

DBADB::replace()
GenericMySQLDB::replace()
SessionDB::replace()

Parameters:

key   $key   The key to replace.
value   $value   The new value for the specified key.

[ Top ]


Documentation generated on Thu, 26 Aug 2010 13:38:48 +0200 by phpDocumentor 1.4.3