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

Class: MDBRecord

Source Location: /framework/db/drivers/mdb.inc.php

http://wact.sourceforge.net/index.php/Record

Record

Class Overview

DataSpace
   |
   --MDBRecord

Encapsulates operations on a database via PEAR::DB.

Variables

Methods


Child classes:

MDBRecordSet
Encapsulates the results of a SELECT, SHOW, DESCRIBE or EXPLAIN sql statement

Inherited Variables

Inherited Methods

Class: DataSpace

DataSpace::export()
Returns a reference to the complete array of properties stored
DataSpace::get()
Gets a copy of a stored property by name
DataSpace::getPath()
Gets a property value by navagating a dot separated path that dereferences elements within the dataspace.
DataSpace::getPropertyList()
Return a unique list of available properties This method is probably going to have capitalization problems.
DataSpace::hasProperty()
Has a value been assigned under this name for this dataspace?
DataSpace::import()
replaces the current properties of this dataspace with the proprties and values passed as a parameter
DataSpace::isDataSource()
Any class that implements the DataSource interface should implement this method This is a PHP4 way of detecting which objects implement the interface.
DataSpace::makeDataSpace()
Static method to convert a variable into a dataspace.
DataSpace::merge()
Append a new list of values to the DataSpace.
DataSpace::prepare()
Prepares the dataspace, executing the doFilter() method of the registered filter, if one exists
DataSpace::registerFilter()
Registers a filter with the dataspace.
DataSpace::remove()
removes stored property value
DataSpace::removeAll()
removes all property values
DataSpace::set()
Stores a copy of value into a Property
DataSpace::setPath()
Stores a copy of value into a Property based on a dot separated path.

Class Details

Encapsulates operations on a database via PEAR::DB.

Generally this class is only used for INSERT, UPDATE and DELETE operations implements Record interface

access:  public
see:  http://wact.sourceforge.net/index.php/Record
see:  Record

Class Variables


$Connection =

Database connection encasulated in PearConnection
var:  instance
access:  private
Type:   PearConnection

Class Methods


constructor MDBRecord

Construct a record

MDBRecord MDBRecord( PearConnection $Connection)

Parameters:

PearConnection   $Connection  

method buildAssignmentList

Build a list of values to assign to columns

array buildAssignmentList( array $fields, array $extrafields)

API Tags:

return:  List of values to assign
access:  protected

Parameters:

array   $fields   associative of field_name => type
array   $extrafields   associative (optional) of field_name => value

method getAffectedRowCount

Gets the number of rows changed by a query

int getAffectedRowCount( )

API Tags:

return:  number of affected rows
access:  public

method insert

INSERTs the values of this record into a single table the field list parameter allows expressions to defined in the sql statements as well as field values defined in the record.

Boolean insert( string $table, array $fields, [string $extrafields = NULL], array 3)

API Tags:

return:  True on success.

Parameters:

array   3   associative (optional) of field_name => value
string   $table   table name
array   $fields   associative of field_name => type
string   $extrafields   (default = null) Name of autoincrement field

method insertId

INSERT a record into a table with a primary key represented by a auto_increment/serial column and return the primary key of the inserted record.

the field list parameter allows expressions to defined in the sql statements as well as field values defined in the record.



integer insertId( string $table, array $fields, string $primary_key_field, [array $extrafields = NULL])

API Tags:

return:  Primary key of the newly inserted record or FALSE if no record was inserted.

Parameters:

string   $table   table name
array   $fields   associative of field_name => type
string   $primary_key_field   Name of primary key field field
array   $extrafields   associative (optional) of field_name => value

method update

Performs an UPDATE on a single table

boolean update( string $table, array $fields, [string $where = NULL], [array $extrafields = NULL])

API Tags:

return:  true on success, false on failure
access:  public

Parameters:

string   $table   table name
array   $fields   associative of field_name => type
string   $where   (optional) SQL where clause
array   $extrafields   associative (optional) of field_name => value
WACT: Copyright 2003 Procata, Inc. Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html)
Documentation generated on Sun, 28 Nov 2004 19:48:10 -0800 by phpDocumentor 1.2.3