Record Class Reference

List of all members.

Public Member Functions

Public Attributes


Member Function Documentation

Record::__construct ( DataSet $ds, $addRecord = false )

 

Creates a new Record and sets the parent dataset to the passed in value.

If $addRecord is true, then an empty record is created.

Parameters
DataSet $ds The parent / owning dataset.
boolean $addRecord Whether to create an empty record.

Record::delete ( Connection $conn = null )

 

Shortcut method to delete this record.
Parameters
Connection $conn

boolean Record::save ( Connection $conn = null )

 

Saves the data in this Record to the database.
Parameters
Connection $conn

Returns boolean True if the save completed. false otherwise.
Exceptions
DataSetException 

string Record::getValue ( $col )

 

Gets the value for specified column. This function performs no type-conversion.
Returns string The value object for specified column as string.
Exceptions
DataSetException 

array Record::columns ( )

 

Get the column names for current record.
Returns array Column names.

the Record::size ( )

 

The number of columns in this object.
Returns the number of columns in this object

boolean Record::toBeSavedWithInsert ( )

 

Whether or not this Record is to be saved with an SQL insert statement
Returns boolean True if saved with insert

boolean Record::toBeSavedWithUpdate ( )

 

Whether or not this Record is to be saved with an SQL update statement
Returns boolean True if saved with update

boolean Record::toBeSavedWithDelete ( )

 

Whether or not this Record is to be saved with an SQL delete statement
Returns boolean True if saved with delete

void Record::markRecordClean ( )

 

Marks all the values in this record as clean.
Returns void

void Record::markForInsert ( )

 

Marks this record to be inserted when a save is executed.
Returns void
Exceptions
DataSetException - if DataSet is not TableDataSet

void Record::markForUpdate ( )

 

Marks this record to be updated when a save is executed.
Returns void
Exceptions
DataSetException - if DataSet is not TableDataSet

void Record::markToBeDeleted ( )

 

Marks this record to be deleted when a save is executed.
Returns void
Exceptions
DataSetException - if DataSet is not TableDataSet

Record::unmarkToBeDeleted ( )

 

Unmarks a record that has been marked for deletion.

WARNING: You must reset the save type before trying to save this record again.

See also markForUpdate()

markForInsert()

markToBeDeleted()

Exceptions
DataSetException 

void Record::markValueClean ( $col )

 

Marks a value with a given column name as clean (unmodified).
Parameters
string $col

Returns void

void Record::markValueDirty ( $col )

 

Marks a value with a given column as "dirty" (modified).
Parameters
string $col

Returns void

void Record::setSaveType ( $type )

 

Sets the internal save type as one of the defined privates (ie: ZOMBIE)
Parameters
int $type

Returns void

int Record::getSaveType ( )

 

Gets the internal save type as one of the defined privates (ie: ZOMBIE)
Returns int

Record Record::setValue ( $col, $value )

 

Sets the value of col.
Returns Record this object.
Exceptions
DataSetException 

boolean Record::isAZombie ( )

 

Determines if this record is a Zombie. A Zombie is a record that has been deleted from the database, but not yet removed from the DataSet.

Returns boolean

boolean Record::needsToBeSaved ( )

 

If the record is not clean, needs to be saved with an Update, Delete or Insert, it returns true.
Returns boolean

true Record::valueIsClean ( $column )

 

Determines whether or not a value stored in the record is clean.
Returns true if clean
Exceptions
DataSetException 

true Record::recordIsClean ( )

 

Goes through all the values in the record to determine if it is clean or not.
Returns true if clean

Record::refresh ( Connection $conn = null )

 

This method refreshes this Record's Value's. It can only be performed on a Record that has not been modified and has been created with a TableDataSet and corresponding KeyDef.

Parameters
Connection $conn

Exceptions
DataSetException 
SQLException 

string Record::getRefreshSql ( )

 

This builds the SELECT statement in order to refresh the contents of this Record. It depends on a valid KeyDef to exist and it must have been created with a TableDataSet.

Returns string The SELECT SQL
Exceptions
DataSetException 

DataSet Record::dataset ( )

 

Gets the DataSet for this Record.

Returns DataSet

Record::setParentDataSet ( DataSet $ds )

 

Sets the parent DataSet for this record.
Parameters
DataSet $ds

string Record::__toString ( )

 

This returns a representation of this Record.
Returns string


Member Data Documentation

const Record::ZOMBIE = -1

 

const Record::UNKNOWN = 0

 

const Record::INSERT = 1

 

const Record::UPDATE = 2

 

const Record::DELETE = 3

 

const Record::BEFOREINSERT = 4

 

const Record::AFTERINSERT = 5

 

const Record::BEFOREUPDATE = 6

 

const Record::AFTERUPDATE = 7

 

const Record::BEFOREDELETE = 8

 

const Record::AFTERDELETE = 9

 


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


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS