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

Class: DataSet

Source Location: /db.inc.php

Class Overview

Object
   |
   --Persistent
      |
      --Component
         |
         --DataSet

DataSet component, base class to inherit and create dataset components


Variables

Methods


Child classes:

DBDataSet
DBDataSet encapsulates database connectivity for descendant dataset objects.
IBDataSet
IBDataSet defines database-related connectivity properties and methods for a dataset.
MySQLDataSet
MySQLDataSet encapsulates database connectivity for descendant dataset objects.
OracleDataSet
OracleDataSet encapsulates database connectivity for descendant dataset objects.

Inherited Variables

Inherited Methods

Class: Component

Component::__construct()
Component constructor
Component::ajaxCall()
Dumps the javascript code to make an ajax call to the server.
Component::callEvent()
Calls a server event.
Component::defaultName()
Component::defaultTag()
Component::dumpChildrenFormItems()
This method is called by the page just after dumping the starting form tag.
Component::dumpChildrenHeaderCode()
Dumps the header code for all the children
Component::dumpChildrenJavascript()
Dumps the javascript code for all the children
Component::dumpFormItems()
Dumps code just after the form tag, useful to dump hidden fields for state retrieving for non visible components
Component::dumpHeaderCode()
Dumps header code required
Component::dumpHiddenKeyFields()
Dumps hidden field values for the key record
Component::dumpJavascript()
Dumps the javascript code needed by this component
Component::dumpJSEvent()
Dumps javascript code for an event
Component::fixupProperty()
Resolves the right reference to an object property
Component::generateAjaxEvent()
Returns the javascript code to generate an ajax call.
Component::getName()
Specifies the name for the component. The name is used as an identifier and should be unique.
Component::getTag()
A versatile property of every Component that can be used in any way you want
Component::hasValidDataField()
Returns true if a valid data field is attached to the component
Component::init()
Initializes a component
Component::insertComponent()
Inserts a component into the component's collection
Component::loaded()
Initializes the component after the form file has been read into memory.
Component::loadedChildren()
Calls childrens loaded
Component::loadResource()
Loads this component from a string
Component::preinit()
Method called before init()
Component::readAccessibility()
Provides accessibility info to the embedded RPC engine.
Component::readComponentCount()
Indicates the number of components owned by the component.
Component::readComponents()
Lists all the components owned by this component.
Component::readControlState()
A flag to know the state of the control, csLoading, csDesigning
Component::readDataFieldValue()
This property returns the value of the datafield if any.
Component::readFromResource()
Reads a component from a resource file
Component::readNamePath()
Specifies the path to uniquely identify a component, qualified by the owner when required.
Component::readOwner()
Indicates the component that is responsible for streaming and freeing this component.
Component::removeComponent()
Removes a component from the component's collection
Component::serializeChildren()
Serializes all children
Component::setName()
Component::setTag()
Component::unserializeChildren()
Unserializes all children by calling unserialize for all the components
Component::updateDataField()
Updates the field on the dataset attached, if any
Component::writeControlState()

Class: Persistent

Persistent::allowserialize()
This method provides an opportunity for the component developer to prevent the serialization/unserialization of a property.
Persistent::assign()
Assigns the source properties to this object.
Persistent::assignError()
Raises an assignation error.
Persistent::assignTo()
Assigns this object to another object.
Persistent::inSession()
This method determines if this object exists in the current session.
Persistent::readNamePath()
Used to serialize/unserialize. It returns the full path to identify this component.
Persistent::readOwner()
Owner of the component.
Persistent::serialize()
Stores this object into the session.
Persistent::unserialize()
This method uses PHP reflection to iterate through published properties (the ones starting with get) and retrieve the properties stored by a previous serialize() call.

Class: Object

Object::__construct()
Constructs an object and initializes its data before the object is first used.
Object::className()
Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).
Object::classNameIs()
Determines whether an object is of a specific type.
Object::classParent()
Returns the type of the immediate ancestor of a class.
Object::inheritsFrom()
Determines the relationship of two object types.
Object::methodExists()
Check if a method exists declared on this object instance.
Object::readProperty()
Reads a property from the streams
Object::__get()
To virtualize properties
Object::__set()
To virtualize properties

Class Details

[line 553]
DataSet component, base class to inherit and create dataset components

A DataSet is a collection of information, organized in rows and fields, and this class implement the basic interface all data-aware components will use to show information.

A DataSet is not attached to an specific source of information, you can, for example, create a DataSet that provide information from a memory array.




[ Top ]


Class Variables

$fieldbuffer = array()

[line 667]

Buffer to hold values for searching/filtering



Tags:

access:  public

Type:   mixed


[ Top ]

$_bof = false

[line 2367]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_canmodify = true

[line 861]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_datasetfield = null

[line 676]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_DefaultFields = false

[line 673]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_DisableCount = 0

[line 674]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_eof = false

[line 2368]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_filter = ""

[line 1164]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_fstreamedactive = false

[line 2311]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_InternalOpenComplete = false

[line 672]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_limitcount = '10'

[line 556]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_limitstart = '0'

[line 555]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_masterfields = array()

[line 712]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_mastersource = null

[line 710]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_modified = false

[line 671]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onaftercancel = null

[line 1087]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onafterclose = null

[line 940]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onafterdelete = null

[line 1124]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onafteredit = null

[line 1011]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onafterinsert = null

[line 976]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onafteropen = null

[line 903]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onafterpost = null

[line 1051]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onbeforecancel = null

[line 1068]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onbeforeclose = null

[line 923]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onbeforedelete = null

[line 1107]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onbeforeedit = null

[line 993]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onbeforeinsert = null

[line 959]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onbeforeopen = null

[line 885]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onbeforepost = null

[line 1029]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_oncalcfields = null

[line 1142]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_ondeleteerror = null

[line 1155]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onfilterrecord = null

[line 1189]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onnewrecord = null

[line 1198]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_onposterror = null

[line 1207]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_reckey = array()

[line 791]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_recno = 0

[line 762]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_recordcount = 0

[line 669]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_state = dsInactive

[line 670]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 1470]

DataSet __construct( [ $aowner = null])



Overrides Component::__construct() (Component constructor)

Parameters:

   $aowner  

[ Top ]

method append [line 1519]

void append( )

Adds a new, empty record to the end of the dataset.

For datasets that permit editing, call Append to:

  1. - Open a new, empty record at the end of the dataset.
  2. - Set the active record to the new record.
After a call to Append, an application can enable users to enter data in the fields of the record, and can then post those changes to the database or change log using Post




Tags:



[ Top ]

method beginInsertAppend [line 1434]

void beginInsertAppend( )

Begins an insert/append operation

This method is called by the dataset to start an insert or append operation, it first checks the browse mode, after that, checks if the dataset can be modified and finally, calls the OnBeforeInsert event




Tags:



[ Top ]

method cancel [line 1546]

void cancel( )

Cancels modifications to the active record if those changes are not yet posted.

Call Cancel to undo modifications made to one or more fields belonging to the active record. As long as those changes are not already posted, Cancel returns the record to its previous state, and sets the dataset state to dsBrowse.

Typically Cancel is used to back out of changes in response to user request, or in field validation routines that back out illegal field values.

Note: If the dataset is not in an editing state (dsEdit or dsInsert), Cancel does nothing.




Tags:



[ Top ]

method checkActive [line 1305]

void checkActive( )

Checks to see if the database connection is active.

Call CheckActive to determine if the connection to a database server is active. If the database connection is inactive, an DatabaseError exception is raised.




Tags:

see:  databaseError()


[ Top ]

method checkBrowseMode [line 1608]

void checkBrowseMode( )

Automatically posts or cancels data changes when the active record changes.

CheckBrowseMode is used internally by many dataset methods to ensure that modifications to the active record are posted when a dataset’s state is dsEdit, dsInsert, or dsSetKey and a method switches to a different record.

If State is dsEdit or dsInsert, CheckBrowseMode calls UpdateRecord, and, if the Modified property for the dataset is true, calls Post. If Modified is false, CheckBrowseMode calls Cancel.

If State is dsSetKey, CheckBrowseMode calls Post.

If State is dsInactive, CheckBrowseMode raises an exception.

If an application uses existing dataset methods, CheckBrowseMode is always called when necessary, so there is usually no need to call CheckBrowseMode directly.

Applications that provide custom dataset routines may need to call CheckBrowseMode inside those routines to guarantee that changes are posted when switching to a different record.




Tags:



[ Top ]

method checkCanModify [line 1318]

void checkCanModify( )

Checks to see if the dataset can be modified.

Call CheckCanModify to determine if the dataset can be modified. If the dataset cannot be modified, an DatabaseError exception is raised.




Tags:

see:  databaseError()


[ Top ]

method checkOperation [line 1222]

void checkOperation( string $Operation, string $ErrorEvent)

Checks if an specific operation can be made, if not, calls $ErrorEvent



Parameters:

string   $Operation   Operation to perform on the dataset
string   $ErrorEvent   Event to call if there is any error

[ Top ]

method checkParentState [line 1697]

void checkParentState( )

Sets the parent dataset in edit state

This is an internal method you don't need to call directly.




Tags:

see:  DataSet::edit()


[ Top ]

method clearBuffers [line 1415]

void clearBuffers( )

Clear buffers associated with the dataset

This method set the dataset buffers to the inital state, that is, recordcount to 0 and bof/eof to true. The fieldbuffer is also cleared to an empty array.




[ Top ]

method close [line 1644]

void close( )

Closes a dataset.

Call Close to set the Active property of a dataset to false. When Active is false, the dataset is closed; it cannot read or write data and data-aware controls can’t use it to fetch data or post edits.

An application must close the dataset before changing properties that affect the status of the database or the controls that display data in an application. For example, to change the DataSource property for a dataset, the dataset must be closed. Closing the dataset puts it into the dsInactive state.




Tags:

see:  DataSet::open()


[ Top ]

method closeCursor [line 1908]

void closeCursor( )

Close the cursor for this dataset

This method is used to close the cursor attached to the dataset, it calls InternalClose, a method you need to override if you are deriving from Dataset.




Tags:



[ Top ]

method controlsDisabled [line 1342]

boolean controlsDisabled( )

Indicates whether data-aware controls update their display to reflect changes to the dataset.

Call ControlsDisabled to ascertain whether the updating of data display in data-aware controls is currently disabled. If ControlsDisabled is true, controls are currently disabled. ControlsDisabled is true as long as the reference count that keeps track of disabling for the dataset is greater than zero. This count is incremented every time the DisableControls method is called and decremented when EnableControls is called. Applications call DisableControls to improve performance and prevent constant updates during automated iterations through records in the dataset.

In complex applications, when controls may be disabled multiple times by different processes, you can use ControlsDisabled as a check in a procedure to reenable controls should each call to DisableControls not be paired with a subsequent call to EnableControls.




Tags:

return:  True if controls has been disabled
see:  disableControls(), enableControls()


[ Top ]

method dataEvent [line 1251]

void dataEvent( integer $event, array $info)

Used to notify attached datasets about an specific event



Parameters:

integer   $event   Event to notify
array   $info   Info for the event

[ Top ]

method defaultActive [line 2364]

void defaultActive( )



[ Top ]

method defaultBOF [line 2390]

void defaultBOF( )



[ Top ]

method defaultCanModify [line 883]

void defaultCanModify( )



[ Top ]

method defaultDataSetField [line 687]

void defaultDataSetField( )



[ Top ]

method defaultEOF [line 2416]

void defaultEOF( )



[ Top ]

method defaultFilter [line 1185]

void defaultFilter( )



[ Top ]

method defaultLimitCount [line 584]

void defaultLimitCount( )



[ Top ]

method defaultLimitStart [line 570]

void defaultLimitStart( )



[ Top ]

method defaultMasterFields [line 734]

void defaultMasterFields( )



[ Top ]

method defaultModified [line 859]

void defaultModified( )



[ Top ]

method defaultOnAfterCancel [line 1105]

void defaultOnAfterCancel( )



[ Top ]

method defaultOnAfterClose [line 957]

void defaultOnAfterClose( )



[ Top ]

method defaultOnAfterDelete [line 1140]

void defaultOnAfterDelete( )



[ Top ]

method defaultOnAfterEdit [line 1027]

void defaultOnAfterEdit( )



[ Top ]

method defaultOnAfterInsert [line 991]

void defaultOnAfterInsert( )



[ Top ]

method defaultOnAfterOpen [line 921]

void defaultOnAfterOpen( )



[ Top ]

method defaultOnAfterPost [line 1066]

void defaultOnAfterPost( )



[ Top ]

method defaultOnBeforeCancel [line 1085]

void defaultOnBeforeCancel( )



[ Top ]

method defaultOnBeforeClose [line 938]

void defaultOnBeforeClose( )



[ Top ]

method defaultOnBeforeDelete [line 1122]

void defaultOnBeforeDelete( )



[ Top ]

method defaultOnBeforeEdit [line 1009]

void defaultOnBeforeEdit( )



[ Top ]

method defaultOnBeforeInsert [line 974]

void defaultOnBeforeInsert( )



[ Top ]

method defaultOnBeforeOpen [line 901]

void defaultOnBeforeOpen( )



[ Top ]

method defaultOnBeforePost [line 1049]

void defaultOnBeforePost( )



[ Top ]

method defaultOnCalcFields [line 1153]

void defaultOnCalcFields( )



[ Top ]

method defaultOnDeleteError [line 1162]

void defaultOnDeleteError( )



[ Top ]

method defaultOnFilterRecord [line 1196]

void defaultOnFilterRecord( )



[ Top ]

method defaultOnNewRecord [line 1205]

void defaultOnNewRecord( )



[ Top ]

method defaultOnPostError [line 1214]

void defaultOnPostError( )



[ Top ]

method defaultRecKey [line 805]

void defaultRecKey( )



[ Top ]

method defaultRecNo [line 789]

void defaultRecNo( )



[ Top ]

method defaultRecordCount [line 1765]

void defaultRecordCount( )



[ Top ]

method defaultState [line 708]

void defaultState( )



[ Top ]

method delete [line 1674]

void delete( )

Deletes the active record and positions the dataset on the next record.

Call Delete to remove the active record from the database. If the dataset is inactive, Delete raises an exception. Otherwise, Delete:

Verifies that the dataset is not empty (and raises an exception if it is).

Calls CheckBrowseMode to post any pending changes to a prior record if necessary.

Calls the OnBeforeDelete event handler.

Deletes the record.

Frees any buffers allocated for the record.

Puts the dataset into dsBrowse mode.

Resynchronizes the dataset to make the next undeleted record active. If the record deleted was the last record in the dataset, then the previous record becomes the current record.

Calls the AfterDelete event handler.




Tags:



[ Top ]

method DisableControls [line 1373]

void DisableControls( )

Disables data display in data-aware controls associated with the dataset.

Call DisableControls prior to iterating through a large number of records in the dataset to prevent data-aware controls from updating every time the active record changes. Disabling controls speeds performance because data does not need to be processed by data-aware controls.

If controls are not already disabled, DisableControls records the current state of the dataset, broadcasts the state change to all associated data-aware controls and detail datasets, and increments the dataset’s disabled count variable. Otherwise, DisableControls just increments the disabled count variable.

The disabled count is used internally to determine whether to display data in data-aware controls. When the disable count variable is greater than zero, data is not updated.

If the dataset is the master of a master/detail relationship, calling DisableControls also disables the master/detail relationship.

Note: Calls to DisableControls can be nested. Only when all calls to DisableControls is matched to a corresponding call to EnableControls does the dataset update data controls and detail datasets.




Tags:

see:  ControlsDisabled(), DataSet::EnableControls()


[ Top ]

method doInternalOpen [line 1834]

void doInternalOpen( )

Performs an internal open of the dataset

This is method called by the dataset to perform an open of the data. It calls InternalOpen, a method you should implement if you are deriving from Dataset.




Tags:

see:  DataSet::open(), readBof()


[ Top ]

method edit [line 1727]

void edit( )

Enables editing of data in the dataset.

Call Edit to permit editing of the active record in a dataset. Edit determines the current state of the dataset. If the dataset is empty, Edit calls Insert. Otherwise Edit:

Calls CheckBrowseMode to post any pending changes to a prior record if necessary.

Checks the CanModify property and raises an exception if the dataset can’t be edited.

Calls the OnBeforeEdit event handler.

Retrieves the record.

Puts the dataset into dsEdit state, enabling the application or user to modify fields in the record.

Broadcasts the state change to associated controls.

Calls the OnAfterEdit event handler.

Modifications will go to a buffer waiting for post()/cancel()




Tags:



[ Top ]

method EnableControls [line 1395]

void EnableControls( )

Enable controls attached to the datasource

Call EnableControls to permit data display in data-aware controls after a prior call to DisableControls. EnableControls decrements the disabled count variable for the dataset if it is not already zero. If the disable count variable is zero, EnableControls updates the current state of the dataset, if necessary, and then tells associated controls to re-enable display.




Tags:



[ Top ]

method endInsertAppend [line 1451]

void endInsertAppend( )

Finishes an insert/append operation

This method is called by a dataset to finish an insert or append operation. It sets the dataset in insert state, calls the OnNewRecord event and finally calls the OnAfterInsert.




Tags:



[ Top ]

method first [line 1791]

void first( )

Moves to the first record in the dataset.

Call First to make the first record in the dataset active. First posts any changes to the active record and:

Clears the record buffers.

Fetches the first record and makes it the active record.

Fetches any additional records required for display, such as those needed to fill out a grid control.

Sets the Bof property to true.

Broadcasts the record change so that data controls and linked detail sets can update.

Note: DataSet uses internal, protected methods to reposition the active record and to fetch additional records required for display. In DataSet, these internal methods are empty stubs. Descendant classes implement these methods to enable the First method to work.




Tags:

see:  DataSet::last(), readBof(), readEof()


[ Top ]

method getLimitCount [line 582]

integer getLimitCount( )

Defines how many records will be shown

Use this property to set how many records do you want to get on the set, at max.




Tags:



[ Top ]

method getLimitStart [line 568]

integer getLimitStart( )

Defines the starting record to filter the dataset with

Use this property to filter the dataset and to set which is the first record to be added to the set.




Tags:



[ Top ]

method initRecord [line 1951]

void initRecord( array $Buffer)

To initialize the current record



Tags:



Parameters:

array   $Buffer   Initial values

[ Top ]

method insert [line 1490]

void insert( )

Inserts a new, empty record in the dataset.

Call Insert to:

  1. - Open a new, empty record in the dataset.
  2. - Set the active record to the new record.
After a call to Insert, an application can allow users to enter data in the fields of the record, and then post those changes to the database or change log using Post.




Tags:



[ Top ]

method internalAddRecord [line 1962]

void internalAddRecord( $buffer, $append)



Parameters:

   $buffer  
   $append  

[ Top ]

method internalCancel [line 1999]

void internalCancel( )

To be overriden to perform a cancel() operation

This method is called when a cancel operation is atempted, so if you are creating new types of datasets, you need to override this method.




Tags:



[ Top ]

method internalClose [line 595]

void internalClose( )

Override this method to perform the closing of the dataset

This method is called internally by the engine to close the dataset. Is not intended to be called directly the component user.




Tags:

see:  Close()


[ Top ]

method internalDelete [line 1974]

void internalDelete( )

To be overriden to perform a delete() operation

This method is called when a delete operation is atempted, so if you are creating new types of datasets, you need to override this method.




Tags:



Overridden in child classes as:

CustomIBTable::internalDelete()

[ Top ]

method internalEdit [line 2011]

void internalEdit( )

To be overriden to perform a edit() operation

This method is called when a edit operation is atempted, so if you are creating new types of datasets, you need to override this method.




Tags:

see:  DataSet::edit()


[ Top ]

method internalFirst [line 1928]

void internalFirst( )

To be overriden to perform a first() operation

This method is called when a first operation is atempted, so if you are creating new types of datasets, you need to override this method.




Tags:



Overridden in child classes as:

IBDataSet::internalFirst()

[ Top ]

method internalHandleException [line 605]

void internalHandleException( )

Override this method to handle exceptions

This method is called internally by the engine to handle an exception using the dataset.

Is not intended to be called directly the component user.




[ Top ]

method internalInitFieldDefs [line 610]

void internalInitFieldDefs( )

Override this method to init field definitions. Not used.



[ Top ]

method internalInitRecord [line 1958]

void internalInitRecord( $buffer)



Parameters:

   $buffer  

[ Top ]

method internalInsert [line 2023]

void internalInsert( )

To be overriden to perform a insert() operation

This method is called when a insert operation is atempted, so if you are creating new types of datasets, you need to override this method.




Tags:



[ Top ]

method internalLast [line 1940]

void internalLast( )

To be overriden to perform a last() operation

This method is called when a last operation is atempted, so if you are creating new types of datasets, you need to override this method.




Tags:

see:  DataSet::last()


[ Top ]

method internalOpen [line 621]

void internalOpen( )

Override this method to perform the opening of the dataset

This method is called internally by the engine to open the dataset. Is not intended to be called directly the component user.




Tags:

see:  DataSet::open()


Overridden in child classes as:

IBDataSet::internalOpen()

[ Top ]

method internalPost [line 1986]

void internalPost( )

To be overriden to perform a post() operation

This method is called when a post operation is atempted, so if you are creating new types of datasets, you need to override this method.




Tags:

see:  DataSet::post()


Overridden in child classes as:

CustomIBTable::internalPost()

[ Top ]

method internalRefresh [line 2035]

void internalRefresh( )

To be overriden to perform a refresh() operation

This method is called when a refresh operation is atempted, so if you are creating new types of datasets, you need to override this method.




Tags:



[ Top ]

method isCursorOpen [line 633]

boolean isCursorOpen( )

Override this method to return if the cursor is open or not

This method is called internally by the engine to determine if the cursor is open or not.

Is not intended to be called directly the component user.




Tags:

return:  True if cursor is open


[ Top ]

method last [line 2062]

void last( )

Moves to the last record in the dataset.

Call Last to make the last record in the dataset active. Last posts any changes to the active record and

Clears the record buffers.

Fetches the last record and makes it the active record.

Fetches any additional records required for display, such as those needed to fill out a grid control.

Sets the Eof property to true.

Broadcasts the record change so that data controls and linked detail sets can update.

Note: DataSet uses internal, protected methods to reposition the active record and to fetch additional records required for display. In DataSet, these internal methods are empty stubs. Descendant classes implement these methods to enable the Last method to work.




Tags:



[ Top ]

method loaded [line 2313]

void loaded( )



Overridden in child classes as:

DBDataSet::loaded()
IBDataSet::loaded()
MySQLDataSet::loaded()
OracleDataSet::loaded()

Overrides Component::loaded() (Initializes the component after the form file has been read into memory.)

[ Top ]

method moveBy [line 2221]

void moveBy( integer $distance)

Moves to another record relative to the active record in the dataset.

Call MoveBy to move the active record by the number of records specified by Distance. A positive value for Distance indicates forward progress through the dataset, while a negative value indicates backward progress.

MoveBy posts any changes to the active record and

Sets the Bof and Eof properties to false.

If Distance is positive, repeatedly fetches Distance subsequent records (if possible), and makes the last record fetched active. If an attempt is made to move past the end of the file, MoveBy sets Eof to true.

If Distance is negative, repeatedly fetches the appropriate number of previous records (if possible), and makes the last record fetched active. If an attempt is made to move past the start of the file, MoveBy sets Bof to true. If the dataset is unidirectional, the dataset raises an EDatabaseError exception when MoveBy tries to fetch a prior record.

Broadcasts information about the record change so that data-aware controls and linked datasets can update.




Tags:



Overridden in child classes as:

IBDataSet::moveBy()

Parameters:

integer   $distance   Records to move the pointer

[ Top ]

method next [line 2126]

void next( )

Moves to the next record in the dataset.

Call Next to move to the next record in the dataset, making it the active record. Next posts any changes to the active record and

Sets the Bof and Eof properties to false.

Fetches the next record and makes it the active record.

Fetches any additional records required for display, such as those needed to fill out a grid control.

Sets the Eof property to true if the last record in the dataset was already active.

Broadcasts the record change so that data controls and linked detail sets can update.

Note: DataSet uses internal, protected methods to move the active record and to fetch additional records required for display. In DataSet, these internal methods are empty stubs. Descendant classes implement these methods to enable the Next method to work.




Tags:



[ Top ]

method open [line 2156]

void open( )

Opens the dataset.

Call Open to set the Active property for the dataset to true. When Active is true, dataset can be populated with data. It can read data from a database or other source (such as a provider). Depending on the CanModify property, active datasets can post changes.

Setting Active to true:

Triggers the OnBeforeOpen event handler if one is defined for the dataset.

Sets the dataset state to dsBrowse.

Establishes a way to fetch data (typically by opening a cursor).

Triggers the After Open event handler if one is defined for the dataset.

If an error occurs during the dataset open, dataset state is set to dsInactive, and any cursor is closed.




Tags:



[ Top ]

method openCursor [line 1853]

void openCursor( [boolean $InfoQuery = False])

Opens the cursor for the dataset

This method is called to open the cursor for this dataset by calling DoInternalOpen.




Tags:



Parameters:

boolean   $InfoQuery   If true, initialize internal field defs

[ Top ]

method OpenCursorComplete [line 1867]

void OpenCursorComplete( )

Finishes the open cursor operation

This method is called when opening a cursor to complete the open operation, it first calls DoInternalOpen and fires the OnAfterOpen event.




Tags:

see:  DoInternalOpen(), Open(), OpenCursor()


[ Top ]

method post [line 2173]

void post( )

Implements a virtual method to write a modified record to the database or change log.

DataSet implements a virtual method to write a modified record to the database or change log. Dataset methods that change the dataset state, such as Edit, Insert, or Append, or that move from one record to another, such as First, Last, Next, and Prior automatically call Post.

Designers of custom datasets can choose whether to implement Post by writing records to the database server or to an internal change log.




Tags:



[ Top ]

method prior [line 2251]

void prior( )

Moves to the previous record in the dataset.

Call Prior to move to the previous record in the dataset, making it the active record. Prior posts any changes to the active record and

Sets the Bof and Eof properties to false.

Fetches the previous record and makes it the active record. If the dataset is unidirectional, it raises an EDatabaseError exception at this point.

Fetches any additional records required for display, such as those needed to fill out a grid control.

Sets the Bof property to true if the first record in the dataset was already active.

Broadcasts the record change so that data controls and linked detail sets can update.

Note: DataSet uses internal, protected methods to move the active record and to fetch additional records required for display. In DataSet, these internal methods are empty stubs. Descendant classes implement these methods to enable the Prior method to work.




Tags:



[ Top ]

method readActive [line 2302]

boolean readActive( )

Specifies whether or not a dataset is open.

Use Active to determine or set whether a dataset is populated with data. When Active is false, the dataset is closed; the dataset cannot read or write data and data-aware controls can not use it to fetch data or post edits. When Active is true, the dataset can be populated with data. It can read data from a database or other source (such as a provider). Depending on the CanModify property, active datasets can post changes.

Setting Active to true:

Generates a OnBeforeOpen event.

Sets the dataset state to dsBrowse.

Establishes a way to fetch data (typically by opening a cursor).

Generates an OnAfterOpen event.

If an error occurs while opening the dataset, dataset state is set to dsInactive, and any cursor is closed.

Setting Active to false:

  1. - Triggers a BeforeClose event.
2 - Sets the State property to dsInactive.

3 - Closes the cursor.

4 - Triggers an AfterClose event.

An application must set Active to false before changing other properties that affect the status of a database or the controls that display data in an application.

Note: Calling the Open method sets Active to true; calling the Close method sets Active to false.




Tags:



[ Top ]

method readBOF [line 2389]

boolean readBOF( )

Indicates whether the first record in the dataset is active.

Test Bof (beginning of file) to determine if the dataset is positioned at the first record. If Bof is true, the active record is unequivocally the first row in the dataset. Bof is true when an application.

Opens a dataset.

Calls a dataset’s First method.

Call a dataset’s Prior method, and the method fails because the first row is already active.

Bof is false in all other cases.




Tags:

see:  EOF(), First()


[ Top ]

method readCanModify [line 881]

boolean readCanModify( )

Indicates whether an application can insert, edit, and delete data in a table.

Check the status of CanModify to determine if an application can modify a dataset in any way. If CanModify is true, the dataset can be modified. If CanModify is false, the table is read-only.

CanModify is set automatically when an application opens a table. If the ReadOnly property of a table component is true, then CanModify is set to false.

Note: Even if CanModify is true, it is not a guarantee that a user will be able to insert or update records in a table. Other factors may come in to play, for example, SQL access privileges.




Tags:



[ Top ]

method readDataSetField [line 685]

Field readDataSetField( )

Indicates the persistent DataSetField object that owns a nested dataset.

Not used.




[ Top ]

method readEOF [line 2415]

boolean readEOF( )

Indicates whether a dataset is positioned at the last record.

Test Eof (end-of-file) to determine if the active record in a dataset is the last record. If Eof is true, the current record is unequivocally the last row in the dataset. Eof is true when an application:

Opens an empty dataset.

Calls a dataset’s Last method. (Unless it is a unidirectional dataset)

Call a dataset’s Next method, and the method fails because the current record is already the last row in the dataset.

Eof is false in all other cases.

Tip: If both Eof and Bof are true, the dataset is empty.




Tags:

see:  BOF(), Last(), Next()


Overridden in child classes as:

DBDataSet::readEOF()
If true, the pointer is at the end of the dataset
IBDataSet::readEOF()
MySQLDataSet::readEOF()
OracleDataSet::readEOF()

[ Top ]

method readFieldCount [line 662]

integer readFieldCount( )

Indicates the number of field components associated with the dataset.

Examine FieldCount to determine the number of fields listed by the Fields property.




Overridden in child classes as:

DBDataSet::readFieldCount()
Number of fields on the current record
IBDataSet::readFieldCount()
MySQLDataSet::readFieldCount()
OracleDataSet::readFieldCount()

[ Top ]

method readFields [line 653]

array readFields( )

This property returns an array with the field names and values

Use Fields to access fields that make up this dataset. The order of field components in Fields corresponds directly to the order of columns in the table or tables underlying a dataset.

Accessing fields with the Fields property is useful for applications that:

Iterate over some or all fields in a dataset.

Work with underlying tables whose internal data structure is unknown at runtime.

If an application knows the data types of individual fields, then it can read or write individual field values through the Fields property.




Overridden in child classes as:

DBDataSet::readFields()
Field array (name=>value) of the current record
IBDataSet::readFields()
MySQLDataSet::readFields()
OracleDataSet::readFields()

[ Top ]

method readFilter [line 1175]

string readFilter( )

Specifies the text of the current filter for a dataset.

Use Filter to specify a dataset filter. When filtering is applied to a dataset, only those records that meet a filter’s conditions are available. Filter describes the filter condition.




[ Top ]

method readMasterFields [line 732]

array readMasterFields( )

Specifies one or more fields in a master table to link with corresponding fields in this table in order to establish a master-detail relationship between the tables.

Use MasterFields after setting the MasterSource property to specify the names of one or more fields to use in establishing a detail-master relationship between this table and the one specified in MasterSource.

MasterFields is an array containing one or more field names in the master table.

Each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this table for display.




Tags:



[ Top ]

method readMasterSource [line 756]

DataSource readMasterSource( )

Specifies the name of the data source for a dataset to use as a master table in establishing a detail-master relationship between this table and another one.

Use MasterSource to specify the name of the data source component whose DataSet property identifies a dataset to use as a master table in establishing a detail-master relationship between this table and another one.

Note: At design time choose an available data source from the MasterSource property’s drop-down list in the Object Inspector.

After setting the MasterSource property, specify which fields to use in the master table by setting the MasterFields property. At runtime each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this table for display.




Tags:



[ Top ]

method readModified [line 857]

boolean readModified( )

Indicates whether the active record is modified.

Check Modified to determine if the active record is modified. If Modified is true, the active record is modified. If false, the active record is not modified.

Note: In general, an application need not check the status of Modified. Properties, events, and methods of TDataSet and its descendants that modify records generally check this status automatically and take appropriate actions based on its value.




Tags:

see:  redCanModify()


[ Top ]

method readOnAfterCancel [line 1103]

mixed readOnAfterCancel( )

Occurs after an application completes a request to cancel modifications to the active record.

Write an OnAfterCancel event handler to take specific action after an application cancels changes to the active record. OnAfterCancel is called by the Cancel method after it updates the current position, releases the lock on the active record if necessary, and sets the dataset state to dsBrowse. If an application requires additional processing before returning control to a user after a Cancel event, code it in the OnAfterCancel event.




Tags:



[ Top ]

method readOnAfterClose [line 955]

mixed readOnAfterClose( )

Occurs after an application closes a dataset.

Write an OnAfterClose event handler to take specific action immediately after an application closes a dataset.

OnAfterClose is called after a dataset is closed and the dataset state is set to dsInactive.




Tags:



[ Top ]

method readOnAfterDelete [line 1138]

mixed readOnAfterDelete( )

Occurs after an application deletes a record.

Write an OnAfterDelete event handler to take specific action immediately after an application deletes the active record in a dataset. OnAfterDelete is called by Delete after it deletes the record, sets the dataset state to dsBrowse, and repositions the current record.




Tags:



[ Top ]

method readOnAfterEdit [line 1025]

mixed readOnAfterEdit( )

Occurs after an application starts editing a record.

Write an OnAfterEdit event handler to take specific action immediately after dataset enters edit mode. OnAfterEdit is called by Edit after it enables editing of a record, recalculates calculated fields, and calls the data event handler to process a record change.




Tags:



[ Top ]

method readOnAfterInsert [line 989]

mixed readOnAfterInsert( )

Occurs after an application inserts a new record.

Write an OnAfterInsert event handler to take specific action immediately after an application inserts a record. The Insert and Append methods generate an OnAfterInsert event after inserting or appending a new record.




Tags:



[ Top ]

method readOnAfterOpen [line 919]

mixed readOnAfterOpen( )

Occurs after an application completes opening a dataset and before any data access occurs.

Write an AfterOpen event handler to take specific action immediately after an application opens the dataset. AfterOpen is called after the dataset establishes access to its data and the dataset is put into dsBrowse state. For example, an AfterOpen event handler might check an ini file to determine the last record touched in the dataset the previous time the application ran, and position the dataset at that record.




Tags:



[ Top ]

method readOnAfterPost [line 1064]

mixed readOnAfterPost( )

Occurs after an application writes the active record to the database or change log and returns to browse state.

Write an OnAfterPost event handler to take specific action immediately after an application posts a change to the active record. OnAfterPost is called after a modification or insertion is made to a record.




Tags:



[ Top ]

method readOnBeforeCancel [line 1083]

mixed readOnBeforeCancel( )

Occurs before an application executes a request to cancel changes to the active record.

Write a OnBeforeCancel event to take specific action before an application carries out a request to cancel changes. OnBeforeCancel is called by the Cancel method before it cancels a dataset operation such as Edit, Insert, or Delete.

An application might use the OnBeforeCancel event to record a user’s changes in an undo buffer.




Tags:



[ Top ]

method readOnBeforeClose [line 936]

mixed readOnBeforeClose( )

Occurs immediately before the dataset closes.

Write a OnBeforeClose event to take specific action before an application closes a dataset. Calling Close or setting the Active property to false results in a call to the OnBeforeClose event handler.




Tags:



[ Top ]

method readOnBeforeDelete [line 1120]

mixed readOnBeforeDelete( )

Occurs before an application attempts to delete the active record.

Write a BeforeDelete event handler to take specific action before an application deletes the active record. OnBeforeDelete is called by Delete before it actually deletes a record.




Tags:



[ Top ]

method readOnBeforeEdit [line 1007]

mixed readOnBeforeEdit( )

Occurs before an application enters edit mode for the active record.

Write a OnBeforeEdit event handler to take specific action before an application enables editing of the active record. For example, an application that keeps a log of database edits could use the OnBeforeEdit event to record the edit request, time, and user before entering edit state.




Tags:



[ Top ]

method readOnBeforeInsert [line 972]

mixed readOnBeforeInsert( )

Occurs before an application enters insert mode.

Write a OnBeforeInsert event handler to take specific action before an application inserts or appends a new record. The Insert or Append method generates a OnBeforeInsert method before it sets the dataset into dsInsert state.




Tags:



[ Top ]

method readOnBeforeOpen [line 899]

mixed readOnBeforeOpen( )

Occurs before an application executes a request to open a dataset.

Write a OnBeforeOpen event handler to take specific action before an application opens a dataset for viewing or editing. OnBeforeOpen is triggered when an application sets the Active property to true for a dataset or an application calls Open.




Tags:



[ Top ]

method readOnBeforePost [line 1047]

mixed readOnBeforePost( )

Occurs before an application posts changes for the active record to the database or change log.

Write a OnBeforePost event handler to take specific action before an application posts dataset changes. OnBeforePost is triggered when an application calls the Post method. Post checks to make sure all required fields are present, then calls OnBeforePost before posting the record.

An application might use OnBeforePost to perform validity checks on data changes before committing them. If it encountered a validity problem, it could call Abort to cancel the Post operation.




Tags:



[ Top ]

method readOnCalcFields [line 1151]

mixed readOnCalcFields( )

Occurs when an application recalculates calculated fields.

(not used)




[ Top ]

method readOnDeleteError [line 1160]

void readOnDeleteError( )

Not used, reserved for future use



[ Top ]

method readOnFilterRecord [line 1194]

void readOnFilterRecord( )

Not used, reserved for future use



[ Top ]

method readOnNewRecord [line 1203]

void readOnNewRecord( )

Not used, reserved for future use



[ Top ]

method readOnPostError [line 1212]

void readOnPostError( )

Not used, reserved for future use



[ Top ]

method readRecKey [line 803]

array readRecKey( )

Specifies the record key for this dataset

This property specifies the fields and values that determine the key of a record.




Tags:



[ Top ]

method readRecNo [line 776]

integer readRecNo( )

Indicates the current record in the dataset.

Examine RecNo to determine the record number of the current record in the dataset. Applications might use this property with RecordCount to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, Next, and Prior.




Tags:



[ Top ]

method readRecordCount [line 1761]

integer readRecordCount( )

Indicates the total number of records associated with the dataset.

As implemented in DataSet, RecordCount is always 0. Ordinarily an application does not access RecordCount at the DataSet level. Instead a redeclared and implemented RecordCount property in a descendant class is accessed. RecordCount provides a fallback property for derived dataset classes that do not reimplement the property access method.




Overridden in child classes as:

DBDataSet::readRecordCount()
Number of records in the dataset
IBDataSet::readRecordCount()
MySQLDataSet::readRecordCount()
OracleDataSet::readRecordCount()
CustomOracleQuery::readRecordCount()

[ Top ]

method readState [line 706]

enum readState( )

Indicates the current operating mode of the dataset.

Examine State to determine the current operating mode of the dataset. State determines what can be done with data in a dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as an application processes data.

Opening a dataset changes State from dsInactive to dsBrowse. An application can call Edit to put a dataset into dsEdit state, or call Insert to put a dataset into dsInsert state.

Posting or canceling edits, insertions, or deletions, changes State from its current state to dsBrowse. Closing a dataset changes its state to dsInactive.




[ Top ]

method refresh [line 2098]

void refresh( )

Re-fetches data from the database to update a dataset’s view of data.

Call Refresh to ensure that an application has the latest data from a database. For example, when an application turns off filtering for a dataset, it should immediately call Refresh to display all records in the dataset, not just those that used to meet the filter condition.

DataSet generates a OnBeforeRefresh event before refreshing the records and an OnAfterRefresh event afterwards.

Warning: Dataset refresh the data by closing and reopening the cursor. This can have unintended side effects if, for example, you have code in the OnBeforeClose, OnAfterClose, OnBeforeOpen, or OnAfterOpen event handlers.




Tags:



[ Top ]

method serialize [line 807]

void serialize( )



Overrides Persistent::serialize() (Stores this object into the session.)

[ Top ]

method setLimitCount [line 583]

void setLimitCount( $value)



Parameters:

   $value  

[ Top ]

method setLimitStart [line 569]

void setLimitStart( $value)



Parameters:

   $value  

[ Top ]

method unserialize [line 826]

void unserialize( )



Overrides Persistent::unserialize() (This method uses PHP reflection to iterate through published properties (the ones starting with get) and retrieve the properties stored by a previous serialize() call.)

[ Top ]

method updateRecord [line 1579]

void updateRecord( )

Ensures that data-aware controls and detail datasets reflect record updates.

UpdateRecord is used internally by some dataset methods to inform data-aware controls of updates and trigger an OnUpdateRecord event if updates are enabled. Applications should not need to call UpdateRecord directly unless they provide custom dataset methods that bypass DataSet methods.




Tags:



[ Top ]

method writeActive [line 2323]

void writeActive( $value)



Parameters:

   $value  

[ Top ]

method writeCanModify [line 882]

void writeCanModify( $value)



Parameters:

   $value  

[ Top ]

method writeDataSetField [line 686]

void writeDataSetField( $value)



Parameters:

   $value  

[ Top ]

method writeFilter [line 1176]

void writeFilter( $value)



Parameters:

   $value  

[ Top ]

method writeMasterFields [line 733]

void writeMasterFields( $value)



Parameters:

   $value  

[ Top ]

method writeMasterSource [line 757]

void writeMasterSource( $value)



Parameters:

   $value  

[ Top ]

method writeModified [line 858]

void writeModified( $value)



Parameters:

   $value  

[ Top ]

method writeOnAfterCancel [line 1104]

void writeOnAfterCancel( $value)



Parameters:

   $value  

[ Top ]

method writeOnAfterClose [line 956]

void writeOnAfterClose( $value)



Parameters:

   $value  

[ Top ]

method writeOnAfterDelete [line 1139]

void writeOnAfterDelete( $value)



Parameters:

   $value  

[ Top ]

method writeOnAfterEdit [line 1026]

void writeOnAfterEdit( $value)



Parameters:

   $value  

[ Top ]

method writeOnAfterInsert [line 990]

void writeOnAfterInsert( $value)



Parameters:

   $value  

[ Top ]

method writeOnAfterOpen [line 920]

void writeOnAfterOpen( $value)



Parameters:

   $value  

[ Top ]

method writeOnAfterPost [line 1065]

void writeOnAfterPost( $value)



Parameters:

   $value  

[ Top ]

method writeOnBeforeCancel [line 1084]

void writeOnBeforeCancel( $value)



Parameters:

   $value  

[ Top ]

method writeOnBeforeClose [line 937]

void writeOnBeforeClose( $value)



Parameters:

   $value  

[ Top ]

method writeOnBeforeDelete [line 1121]

void writeOnBeforeDelete( $value)



Parameters:

   $value  

[ Top ]

method writeOnBeforeEdit [line 1008]

void writeOnBeforeEdit( $value)



Parameters:

   $value  

[ Top ]

method writeOnBeforeInsert [line 973]

void writeOnBeforeInsert( $value)



Parameters:

   $value  

[ Top ]

method writeOnBeforeOpen [line 900]

void writeOnBeforeOpen( $value)



Parameters:

   $value  

[ Top ]

method writeOnBeforePost [line 1048]

void writeOnBeforePost( $value)



Parameters:

   $value  

[ Top ]

method writeOnCalcFields [line 1152]

void writeOnCalcFields( $value)



Parameters:

   $value  

[ Top ]

method writeOnDeleteError [line 1161]

void writeOnDeleteError( $value)



Parameters:

   $value  

[ Top ]

method writeOnFilterRecord [line 1195]

void writeOnFilterRecord( $value)



Parameters:

   $value  

[ Top ]

method writeOnNewRecord [line 1204]

void writeOnNewRecord( $value)



Parameters:

   $value  

[ Top ]

method writeOnPostError [line 1213]

void writeOnPostError( $value)



Parameters:

   $value  

[ Top ]

method writeRecKey [line 804]

void writeRecKey( $value)



Parameters:

   $value  

[ Top ]

method writeRecNo [line 777]

void writeRecNo( $value)



Parameters:

   $value  

[ Top ]

method writeState [line 707]

void writeState( $value)



Parameters:

   $value  

[ Top ]


Documentation generated on Sat, 13 Jun 2009 10:51:22 -0700 by phpDocumentor 1.4.1