Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: c:/www/apache/doc2//pear/DB/storage.php
PEAR 2000/12/03 -

DB_storage

DB_storage

Warning: documentation is missing.

 

private class DB_storage


 

Public Method Summary

void

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

Constructor, adds itself to the DB_storage class's list of

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
string

toString()

Output a simple description of this DB_storage object.
void

dump()

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

&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()

Warning: documentation is missing.
void

set( $property, &$newvalue)

Warning: documentation is missing.
void

&get( $property)

Warning: documentation is missing.
void

destroy(boolean $discard)

Warning: documentation is missing.
void

store()

Warning: documentation is missing.

Private Field Summary

string

$_table

the name of the table (or view, if the backend database supports
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
array

$_changes

an assoc with the names of the properties in this object that
boolean

$_readonly

flag that decides if data in this object can be changed.

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 whenPHP shuts down (poor man's destructors).

Parameter
$table
Warning: documentation is missing.
$keycolumn
Warning: documentation is missing.
&$dbh
Warning: documentation is missing.
Returns void


Private Method Details

setup

private int setup( $keyval )

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

Parameter
$keyval
Warning: documentation is missing.
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
Warning: documentation is missing.
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 a &create( array $table, &$data )

  Static method used to create new DB storage objects.

Parameter
array $table
the keys are the names
of properties/columns
&$data
Warning: documentation is missing.
Returns object 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 andthe object re-initialized first.

Parameter
$query
Warning: documentation is missing.
boolean $params
Warning: documentation is missing.
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( )

 

Warning: documentation is missing.

Returns void


set

private void set( $property, &$newvalue )

 

Warning: documentation is missing.

Parameter
$property
Warning: documentation is missing.
&$newvalue
Warning: documentation is missing.
Returns void


&get

private void &get( $property )

 

Warning: documentation is missing.

Parameter
$property
Warning: documentation is missing.
Returns void


destroy

private void destroy( boolean $discard )

 

Warning: documentation is missing.

Parameter
boolean $discard
Warning: documentation is missing.
Returns void


store

private void store( )

 

Warning: documentation is missing.

Returns void


Private Field Details

$_table

private string $_table

>>null<<

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


$_keycolumn

private string $_keycolumn

>>null<<

which column in the table contains primary keys *


$_dbh

private string $_dbh

>>null<<

DB connection handle used for all transactions *


$_properties

private array $_properties

>>array()<<

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


$_changes

private array $_changes

>>array()<<

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


$_readonly

private boolean $_readonly

>>false<<

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



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta