TableDataSet Class Reference

Inherits DataSet.

List of all members.

Public Member Functions

Public Attributes


Constructor & Destructor Documentation

TableDataSet::TableDataSet ( &$  conn,  $  tableName,  $  p3 = null,  $  p4 = null )

 

Construct new TableDataSet instance.

Supports a few signatures:

  • new TableDataSet($conn, "mytable", "col1, col2")
  • new TableDataSet($conn, "mytable", new KeyDef(...))
  • new TableDataSet($conn, "mytable", "col1, col2", new KeyDef(...))

Parameters:
Connection $conn
string $tableName
mixed $p3 KeyDef or column list (string)
mixed $p4 KeyDef or column list (string)


Member Function Documentation

TableDataSet::tableName ()

 

Gets the tableName defined in the schema

Returns string

& TableDataSet::tableInfo ()

 

Load the TableInfo (metadata) object for this table.

Returns TableInfo on success, SQLException if current conn doesn't know about $this->tableName

& TableDataSet::fetchRecords ( $  p1 = 0,  $  p2 = null )

 

Fetch start to max records. start is at Record 0

Parameters:
int $start
int $max

Returns TableDataSet This object on success, SQL- or DataSetException on failure.

Reimplemented from DataSet.

& TableDataSet::addRecord ()

 

Creates a new Record within this DataSet

Returns Record The added record on success, SQL - or DataSetException on failure.

TableDataSet::save ()

 

Saves all the records in the DataSet.

Returns int Total number of records updated/inserted/deleted on success, SQL- or DataSetException on failure.

TableDataSet::removeDeletedRecords ()

 

Removes any records that are marked as a zombie.

Returns void

TableDataSet::setOptimisticLockingColumn ( $  olc)

 

Sets the table column used for optomistic locking.

Parameters:
string $olc

TableDataSet::optimisticLockingCol ()

 

Gets the table column used for optomistic locking.

Returns string

& TableDataSet::where ( $  where)

 

Sets the value for the SQL portion of the WHERE statement.

Returns instance of self on success, DataSetException on failure.

& TableDataSet::getWhere ()

 

Gets the value of the SQL portion of WHERE.

Returns string

& TableDataSet::order ( $  order)

 

Sets the value for the SQL portion of the ORDER statement

Returns TableDataSet instance of self on success, DataSetException on failure.

& TableDataSet::getOrder ()

 

Gets the value of the SQL portion of ORDER.

Returns string

& TableDataSet::other ( $  other)

 

Sets the value for the SQL portion of the OTHER statement

Parameters:
string $other

Returns TableDataSet instance of self

Exceptions:
DataSetException 

& TableDataSet::getOther ()

 

Gets the value of the SQL portion of OTHER.

Returns string

TableDataSet::refresh ()

 

This method refreshes all of the Records stored in this TableDataSet.

Returns mixed boolean TRUE on success, SQL- or DataSetException on failure.

TableDataSet::setRefreshOnSave ( $  v)

 

Setting this causes each Record to refresh itself when a save() is performed on it.

Default value is false.

Parameters:
boolean $v

Returns true if it is on; false otherwise

TableDataSet::refreshOnSave ()

 

Setting this causes each Record to refresh itself when a save() is performed on it.

Default value is false.

Returns boolean True if it is on; false otherwise

TableDataSet::getSelectSql ()

 

Builds the select string that was used to populate this TableDataSet.

Returns SQL select string

Reimplemented from DataSet.

TableDataSet::buildSelectString ()

 

Used by getSelectSql() to build the select string that was used to populate this TableDataSet.

private

See also getSelectSql()

Returns void


Member Data Documentation

TableDataSet::$tableName

 

Name of current table

TableDataSet::$tableInfo

 

TableInfo (metadata) object

TableDataSet::$optimisticLockingCol

 

the optimistic locking column value

TableDataSet::$where

 

the value for the sql where clause

TableDataSet::$order

 

the value for the sql order by clause

TableDataSet::$other

 

the value for the sql other clause

TableDataSet::$refreshOnSave = false

 

Whether to reload record values when save() is performed.


This file is part of the Creole[php4] library.


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS