[ Index ]
 

Code source de Claroline 188

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/claroline/inc/lib/pear/DB/ -> storage.php (sommaire)

(pas de description)

Poids: 495 lignes (15 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

DB_storage:: (12 méthodes):
  DB_storage()
  _makeWhere()
  setup()
  insert()
  toString()
  dump()
  create()
  set()
  get()
  _DB_storage()
  store()
  remove()


Classe: DB_storage  - X-Ref

Provides an object interface to a table row.

It lets you add, delete and change rows using objects rather than SQL
statements.

DB_storage($table, $keycolumn, &$dbh, $validator = null)   X-Ref
Constructor

param: $table string the name of the database table
param: $keycolumn mixed string with name of key column, or array of
param: $dbh object database connection object
param: $validator mixed function or method used to validate

_makeWhere($keyval = null)   X-Ref
Utility method to build a "WHERE" clause to locate ourselves in
the table.

XXX future improvement: use rowids?


setup($keyval)   X-Ref
Method used to initialize a DB_storage object from the
configured table.

param: $keyval mixed the key[s] of the row to fetch (string or array)
return: int DB_OK on success, a DB error if not

insert($newpk)   X-Ref
Create a new (empty) row in the configured table for this
object.


toString()   X-Ref
Output a simple description of this DB_storage object.

return: string object description

dump()   X-Ref
Dump the contents of this object to "standard output".


create($table, &$data)   X-Ref
Static method used to create new DB storage objects.

param: $data assoc. array where the keys are the names
return: object a new instance of DB_storage or a subclass of it

set($property, $newvalue)   X-Ref
Modify an attriute value.


get($property)   X-Ref
Fetch an attribute value.

param: string attribute name
return: attribute contents, or null if the attribute name is

_DB_storage()   X-Ref
Destructor, calls DB_storage::store() if there are changes
that are to be kept.


store()   X-Ref
Stores changes to this object in the database.

return: DB_OK or a DB error

remove()   X-Ref
Remove the row represented by this object from the database.

return: mixed DB_OK or a DB error



Généré le : Thu Nov 29 14:38:42 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics