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

Class: TableDataSet

Source Location: /jargon/TableDataSet.php

Class Overview

DataSet
   |
   --TableDataSet

This class is used for doing select/insert/delete/update on the database.


Author(s):

Version:

  • $Revision: 1.3 $

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: DataSet

DataSet::allRecordsRetrieved()
Check if all the records have been retrieve
DataSet::clearRecords()
Remove all records from the DataSet and nulls those records out and close() the DataSet.
DataSet::close()
Releases the records, closes the ResultSet and the Statement, and nulls the Schema and Connection references.
DataSet::connection()
Gets the current database connection
DataSet::containsRecord()
Check to see if the DataSet contains a Record at 0 based position
DataSet::fetchRecords()
Causes the DataSet to hit the database and fetch max records, starting at start. Record count begins at 0.
DataSet::findRecord()
Find Record at 0 based index position. This is an internal alternative to getRecord which tries to be smart about the type of record it is.
DataSet::getColumns()
Returns the columns attribute for the DataSet
DataSet::getIterator()
Return iterator (for IteratorAggregate interface).
DataSet::getRecord()
Get Record at 0 based index position
DataSet::getSelectSql()
Classes extending this class must implement this method.
DataSet::keydef()
gets the KeyDef object for this DataSet
DataSet::lastFetchSize()
The number of records that were fetched with the last fetchRecords.
DataSet::releaseRecords()
Removes the records from the DataSet, but does not null the records out
DataSet::removeRecord()
Remove a record from the DataSet's internal storage
DataSet::reset()
Essentially the same as releaseRecords, but it won't work on a QueryDataSet that has been created with a ResultSet
DataSet::resultSet()
Gets the ResultSet for this DataSet
DataSet::schema()
Gets the Schema for this DataSet
DataSet::setAllRecordsRetrieved()
Set all records retrieved
DataSet::size()
Gets the number of Records in this DataSet. It is 0 based.
DataSet::__toString()
This returns a represention of this DataSet

Class Details

[line 39]
This class is used for doing select/insert/delete/update on the database.

A TableDataSet cannot be used to join multiple tables for an update, if you need join functionality on a select, you should use a QueryDataSet.




Tags:

version:  $Revision: 1.3 $
author:  Jon S. Stevens <jon@latchkey.com> (Village)
author:  Hans Lellelid <hans@xmpl.org> (Jargon)


[ Top ]


Class Methods


constructor __construct [line 75]

TableDataSet __construct( Connection $conn, string $tableName, [mixed $p3 = null], [mixed $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(...))




Tags:

access:  public


Parameters:

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

[ Top ]

method addRecord [line 138]

Record addRecord( )

Creates a new Record within this DataSet



Tags:

return:  The added record
access:  public
throws:  DataSetException
throws:  SQLException


[ Top ]

method fetchRecords [line 125]

TableDataSet fetchRecords( [mixed $p1 = 0], [mixed $p2 = null], int $start, int $max)

Fetch start to max records. start is at Record 0



Tags:

return:  This object.
access:  public
throws:  SQLException
throws:  DataSetException


Overrides DataSet::fetchRecords() (Causes the DataSet to hit the database and fetch max records, starting at start. Record count begins at 0.)

Parameters:

int   $start  
int   $max  

[ Top ]

method getOrder [line 243]

string getOrder( )

Gets the value of the SQL portion of ORDER.



Tags:

access:  public


[ Top ]

method getOther [line 267]

string getOther( )

Gets the value of the SQL portion of OTHER.



Tags:

access:  public


[ Top ]

method getSelectSql [line 312]

SQL getSelectSql( )

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



Tags:

return:  select string
access:  public


Overrides DataSet::getSelectSql() (Classes extending this class must implement this method.)

[ Top ]

method getWhere [line 219]

string getWhere( )

Gets the value of the SQL portion of WHERE.



Tags:

access:  public


[ Top ]

method optimisticLockingCol [line 196]

string optimisticLockingCol( )

Gets the table column used for optomistic locking.



Tags:

access:  public


[ Top ]

method order [line 230]

TableDataSet order( mixed $order)



Tags:

return:  instance of self
access:  public
throws:  DataSetException


[ Top ]

method other [line 254]

TableDataSet other( string $other)

Sets the value for the SQL portion of the OTHER statement



Tags:

return:  instance of self
access:  public
throws:  DataSetException


Parameters:

string   $other  

[ Top ]

method refresh [line 277]

void refresh( )

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



Tags:

access:  public
throws:  SQLException, DataSetException


[ Top ]

method refreshOnSave [line 303]

boolean refreshOnSave( )

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

Default value is false.




Tags:

return:  True if it is on; false otherwise
access:  public


[ Top ]

method removeDeletedRecords [line 170]

void removeDeletedRecords( )

Removes any records that are marked as a zombie.



Tags:

access:  public
throws:  DataSetException


[ Top ]

method save [line 151]

int save( )

Saves all the records in the DataSet.



Tags:

return:  Total number of records updated/inserted/deleted.
access:  public
throws:  SQLException, DataSetException


[ Top ]

method setOptimisticLockingColumn [line 187]

void setOptimisticLockingColumn( string $olc)

Sets the table column used for optomistic locking.



Tags:

access:  public


Parameters:

string   $olc  

[ Top ]

method setRefreshOnSave [line 291]

true setRefreshOnSave( boolean $v)

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

Default value is false.




Tags:

return:  if it is on; false otherwise
access:  public


Parameters:

boolean   $v  

[ Top ]

method tableInfo [line 108]

TableInfo tableInfo( )

Load the TableInfo (metadata) object for this table.



Tags:

access:  public
throws:  SQLException if current conn doesn't know about $this->tableName


[ Top ]

method tableName [line 98]

string tableName( )

Gets the tableName defined in the schema



Tags:

access:  public
throws:  DataSetException


[ Top ]

method where [line 206]

instance where( mixed $where)

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



Tags:

return:  of self
access:  public
throws:  DataSetException


[ Top ]


Documentation generated on Mon, 23 Aug 2004 21:53:25 -0400 by phpDocumentor 1.3.0RC3