TableDataSet Class Reference

Inherits DataSet.

List of all members.

Public Member Functions


Member Function Documentation

TableDataSet::__construct ( Connection $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)

string TableDataSet::tableName ( )

 

Gets the tableName defined in the schema
Returns string
Exceptions
DataSetException 

TableInfo TableDataSet::tableInfo ( )

 

Load the TableInfo (metadata) object for this table.
Returns TableInfo
Exceptions
SQLException if current conn doesn't know about $this->tableName

TableDataSet 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.
Exceptions
SQLException 
DataSetException 

Record TableDataSet::addRecord ( )

 

Creates a new Record within this DataSet

Returns Record The added record
Exceptions
DataSetException 
SQLException 

int TableDataSet::save ( )

 

Saves all the records in the DataSet.
Returns int Total number of records updated/inserted/deleted.
Exceptions
SQLException,DataSetException 

void TableDataSet::removeDeletedRecords ( )

 

Removes any records that are marked as a zombie.
Returns void
Exceptions
DataSetException 

TableDataSet::setOptimisticLockingColumn ( $olc )

 

Sets the table column used for optomistic locking.
Parameters
string $olc

string TableDataSet::optimisticLockingCol ( )

 

Gets the table column used for optomistic locking.
Returns string

instance TableDataSet::where ( $where )

 

Sets the value for the SQL portion of the WHERE statement.
Returns instance of self
Exceptions
DataSetException 

string TableDataSet::getWhere ( )

 

Gets the value of the SQL portion of WHERE.
Returns string

TableDataSet TableDataSet::order ( $order )

 

Sets the value for the SQL portion of the ORDER statement

Returns TableDataSet instance of self
Exceptions
DataSetException 

string TableDataSet::getOrder ( )

 

Gets the value of the SQL portion of ORDER.
Returns string

TableDataSet TableDataSet::other ( $other )

 

Sets the value for the SQL portion of the OTHER statement
Parameters
string $other

Returns TableDataSet instance of self
Exceptions
DataSetException 

string TableDataSet::getOther ( )

 

Gets the value of the SQL portion of OTHER.
Returns string

void TableDataSet::refresh ( )

 

This method refreshes all of the Records stored in this TableDataSet.
Exceptions
SQLException,DataSetException 

Returns void

true 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

boolean 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

SQL TableDataSet::getSelectSql ( )

 

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


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


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS