Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/cch/www/pear/DB/storage.php
PEAR Repository -

DB_storage

DB_storage

 

private class DB_storage

 

Public Method Summary

void

DB_storage( $table, $keycolumn, &$dbh)

Constructor, adds itself to the DB_storage class's list of
objects that should have their "destroy" method called when
PHP shuts down (poor man's destructors).

Private Method Summary

int

setup( $keyval)

Method used to initialize a DB_storage object from the
void

insert(boolean $newid)

Create a new (empty) row in the configured table for this
object.
string

toString()

Output a simple description of this DB_storage object.
void

dump()

Dump the contents of this object to "standard output".
object [unknown]

&create(array $table, &$data)

Static method used to create new DB storage objects.
int

loadFromQuery( $query, boolean $params)

Loads data into this object from the given query. If this
void

DB_storage_destructor()

void

set( $property, &$newvalue)

void

&get( $property)

void

destroy(boolean $discard)

void

store()

Private Field Summary

string

$_table

the name of the table (or view, if the backend database supports
updates in views) we hold data from *
string

$_keycolumn

which column in the table contains primary keys *
string

$_dbh

DB connection handle used for all transactions *
array

$_properties

an assoc with the names of database fields stored as properties
in this object *
array

$_changes

an assoc with the names of the properties in this object that
have been changed since they were fetched from the database *
boolean

$_readonly

flag that decides if data in this object can be changed.
objects that don't have their table's key column in their
property lists will be flagged as read-only. *

Public Method Details

DB_storage

public void DB_storage( $table, $keycolumn, &$dbh )

  Constructor, adds itself to the DB_storage class's list of
objects that should have their "destroy" method called when
PHP shuts down (poor man's destructors).

Parameter
$table
$keycolumn
&$dbh
Returns void


Private Method Details

setup

private int setup( $keyval )

  Method used to initialize a DB_storage object from the
configured table.

Parameter
$keyval
Returns int

DB_OK on success, DB error if not


insert

private void insert( boolean $newid )

  Create a new (empty) row in the configured table for this
object.

Parameter
boolean $newid
Returns void


toString

private string toString( )

  Output a simple description of this DB_storage object.

Returns string

object description


dump

private void dump( )

  Dump the contents of this object to "standard output".

Returns void


&create

private object [unknown] &create( array $table, &$data )

  Static method used to create new DB storage objects.

Parameter
array $table
where the keys are the names
of properties/columns
&$data
Returns object [unknown]

a new instance of DB_storage or a subclass of it


loadFromQuery

private int loadFromQuery( $query, boolean $params )

  Loads data into this object from the given query. If this
object already contains table data, changes will be saved and
the object re-initialized first.

Parameter
$query
boolean $params
Returns int

DB_OK on success, DB_WARNING_READ_ONLY if the
returned object is read-only (because the object's specified
key column was not found among the columns returned by $query),
or another DB error code in case of errors.


DB_storage_destructor

private void DB_storage_destructor( )

 

Returns void


set

private void set( $property, &$newvalue )

 

Parameter
$property
&$newvalue
Returns void


&get

private void &get( $property )

 

Parameter
$property
Returns void


destroy

private void destroy( boolean $discard )

 

Parameter
boolean $discard
Returns void


store

private void store( )

 

Returns void


Private Field Details

$_table

private string $_table

>>null<<


$_keycolumn

private string $_keycolumn

>>null<<


$_dbh

private string $_dbh

>>null<<


$_properties

private array $_properties

>>array()<<


$_changes

private array $_changes

>>array()<<


$_readonly

private boolean $_readonly

>>false<<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta