Object | --Persistent | --Component | --DataSet
Located in File: /db.inc.php
Child classes might encapsulate access to a simple array in memory, a text file in disk, or even a query on a database.
![]() | LimitCount | Number of records from the data provider to be provided by the dataset. |
![]() | LimitStart | Number of records from the data provider to be skipped in the dataset, from the start. |
![]() | Active | Whether the dataset is open (true) or closed (false). You cannot work on a closed dataset. |
![]() | BOF | Whether the current record is the first record of the dataset (true) or not (false). |
![]() | CanModify | Whether the dataset can be modified (true) or it is read-only (false). |
![]() | EOF | Whether the current record is the last record of the dataset (true) or not (false). |
![]() | FieldBuffer | Associative array of key-value pairs describing the content (field-value) of the current record in the underlying storage system. |
![]() | FieldCount | Number of fields of the current record. |
![]() | Fields | Associative array of key-value pairs describing the content (field-value) of the current record in the dataset. |
![]() | Filter | Filter to be applied when retrieving records from the data provider. Only the records matching the conditions defined in the filter will be retrieved and available in the dataset. |
![]() | MasterFields | Associative array of key-value pairs, where the 'key' is the name of a field in this dataset, and the 'value' is the name of a field from the MasterSource. This association is used to filter the records retrieved from the data provider into the dataset. |
![]() | MasterSource | Instance of DataSet to be used to filter the records that this dataset retrieves from the data provider. |
![]() | Modified | Whether the current record has been modified (true) or not (false). For new records, this function returns true when any of its fields has been given a value. |
![]() | RecNo | Number that represents the position of the current record in the dataset. |
![]() | RecordCount | Total number of records in the dataset. |
![]() | State | Current state of the dataset. |
Defined in class Component |
||
![]() | Cached | Whether the caching feature should be enabled (true, "1") or not (false, "0"). |
![]() | Name | Specifies the name for the component. The name is used as an identifier and should be unique. |
![]() | Tag | A versatile property of every Component that can be used in any way you want |
![]() | ComponentCount | Indicates the number of components owned by the component. |
![]() | Components | Lists all the components owned by this component. |
![]() | ControlState | A flag indicating the state of the control. |
![]() | CSSDescriptor | Returns the CSS descriptor for the component |
![]() | DataFieldValue | This property returns the value of the datafield if any. |
![]() | NamePath | Specifies the path to uniquely identify a component, qualified by the owner when required. |
![]() | Owner | Indicates the component that is responsible for streaming and freeing this component. |
Defined in class Persistent |
||
![]() | NamePath | Used to serialize/unserialize. It returns the full path to identify this component. |
![]() | Owner | Owner of the component. |
For example, if this property is set to "10", the dataset will only contain 10 records from the data provider.
For example, if this property is set to "10", the first record in the dataset will be the 11th record from the data provider.
Any change to the current record that has not been posted yet will not be reflected in this array.
Any change to the current record will be reflected in this array, even if it has not been posted to the underlying storage system yet.
Suppose you have two datasets, named MasterDataSet and SlaveDataSet, where SlaveDataSet (this dataset) has MasterDataSet associated to its MasterSource property (MasterSource = $MasterDataSet), and SlaveDataSet's MasterFields property is defined as array('category_id' => 'id').
As a result of the configuration above, SlaveDataSet would only contain records whose 'category_id' field has the same value as the 'id' field of the current record of the MasterDataSet.
This property must be used in combination with MasterFields, else it is useless.
Change this property to navigate to a record in a different position.
'dsInactive' indicates the dataset is closed. 'dsBrowse' is the standard state when the dataset is open. 'dsEdit' indicates that a record of the dataset is being modified. 'dsInsert' indicates that a new record, to be added to the dataset, is being defined.
![]() | append | Begins an append operation for the current record. |
![]() | beginInsertAppend | Prepares the dataset to enter insert/append mode. |
![]() | cancel | Stops the current operation to modify the dataset without applying any change, effectively rejecting those changes. |
![]() | checkActive | Raises an exception if the dataset is not open. |
![]() | checkBidirectional | Raises an exception if the dataset is not bidirectional, but unidirectional. |
![]() | checkBrowseMode | If the dataset is open and the dataset is in append/edit/insert mode, it posts any unsaved changes to the data provider, and takes the dataset back into browse mode. |
![]() | checkCanModify | Raises an exception if the dataset is read-only. |
![]() | checkOperation | Calls the given $method that performs an operation on the DataSet. |
![]() | checkStateToModify | Raises an exception if the dataset is not in append/edit/insert mode. |
![]() | clearBuffers | Empties the buffer for the current record. |
![]() | close | Closes the dataset. The dataset will be emptied of records, and you won't be able to work with the dataset until you open it again. |
![]() | delete | Removes the current record from the dataset. |
![]() | edit | Begins an edit operation for the current record. |
![]() | endInsertAppend | Performs some steps that are needed after setting the dataset to either the append or the insert modes. |
![]() | first | Points the record cursor to the first record in the dataset. |
![]() | freeFieldBuffers | Empties the buffer for the current record. |
![]() | initRecord | Empties (sets to NULL) the value of any field in the current record. |
![]() | insert | Begins an insert operation for the current record. |
![]() | internalCancel | Cancels the posting to the data provider of the changes made to the dataset. |
![]() | internalClose | Empties the dataset from any data. |
![]() | internalDelete | Deletes the current record from the data provider. |
![]() | internalEdit | Takes the dataset into edit mode. |
![]() | internalFirst | Points the record cursor to the first record in the data provider. |
![]() | internalInsert | Takes the dataset into insert/append mode. |
![]() | internalLast | Points the record cursor to the last record in the data provider. |
![]() | internalMoveBy | Moves the record cursor the given number of positions in the data provider. Negative values move the cursor backwards. |
![]() | internalOpen | Fills the dataset with the records from its data provider. |
![]() | internalPost | Posts to the data provider the changes made to the dataset. |
![]() | isUnidirectional | Returns true if the dataset is unidirectional, false otherwise. |
![]() | last | Points the record cursor to the last record in the dataset. |
![]() | loaded | Initializes the component after the form file has been read into memory. [Overrides Component::loaded()] |
![]() | moveBy | Moves the record cursor the given number of positions. Use negative values to move the cursor backwards. |
![]() | next | Points the record cursor to the next record in the dataset. |
![]() | NextRecord | Points the record cursor to the next record. |
![]() | open | Opens the dataset. When a dataset is opened, it gets filled with the records from its data provider. |
![]() | post | Stops the current operation to modify the dataset, and performs the actual changes. |
![]() | prior | Points the record cursor to the previous record in the dataset. |
![]() | PriorRecord | Points the record cursor to the previous record. |
![]() | refresh | Reloads the dataset with the records from the data provider. |
![]() | serialize | Stores this object into the session. [Overrides Persistent::serialize()] |
![]() | unserialize | This method uses PHP reflection to iterate through published properties (those for which there is a getter method) and retrieve those stored by a previous call to serialize(). [Overrides Persistent::unserialize()] |
![]() | updateFieldBuffer | Updates the field buffer, the buffer containing the unsaved changes to the current record. |
Defined in class Component |
||
![]() | __construct | Component constructor. |
![]() | ajaxCall | Dumps the JavaScript code to make an AJAX call to the server-side version of the script. |
![]() | beginCache | Start caching from here. |
![]() | bindjQueryEvent | Returns the javascript code to bind a js event with JQuery |
![]() | bindJSEvent | Returns the javascript code to bind a js event |
![]() | callEvent | Calls a server event. |
![]() | dumpAdditionalCSS | Dumps additional CSS code required by the component. |
![]() | dumpChildrenFormItems | This method is called by the page just after dumping the starting form tag. |
![]() | dumpChildrenHeaderCode | Dumps the header code for all the children |
![]() | dumpChildrenJavascript | Dumps the JavaScript code for all the children components. |
![]() | dumpContents | Renders the control. |
![]() | dumpCSS | Dumps CSS code required by the component. |
![]() | dumpFormItems | Dumps code just after the form tag, useful to dump hidden fields for state retrieving for non visible components |
![]() | dumpHeaderCode | Dumps code in the header of the final webpage required by the component. |
![]() | dumpHiddenKeyFields | Dumps hidden field values for the key record |
![]() | dumpJavascript | Dumps JavaScript code required by the component. |
![]() | dumpJSEvent | Dumps javascript code for an event |
![]() | endCache | Stop caching at this point. |
![]() | fixupProperty | Resolves the right reference to an object property |
![]() | generateAjaxEvent | Returns the javascript code to generate an ajax call. |
![]() | hasValidDataField | Returns true if a valid data field is attached to the component |
![]() | init | Initializes a component |
![]() | insertComponent | Inserts a component into the component's collection |
![]() | loaded | Initializes the component after the form file has been read into memory. |
![]() | loadedChildren | Iterates through any component in the page, and calls its loaded() method. |
![]() | loadResource | Loads this component from a string. |
![]() | pagecreate | Prints client-side code that should be executed once the DOM is loaded on the user agent. |
![]() | preinit | Method called before init(). |
![]() | removeComponent | Removes a component from the component's collection |
![]() | serializeChildren | Serializes all children |
![]() | show | Dumps the code for the control to the output. |
![]() | showCSS | Dumps the CSS for the component, qualifying it by the owner name, so you can mix pages in the same page |
![]() | unserializeChildren | Unserializes all children by calling unserialize for all the components |
![]() | updateDataField | Updates the field on the dataset attached, if any |
Defined in class Persistent |
||
![]() | allowserialize | This method provides an opportunity for the component developer to prevent the serialization/unserialization of a property. |
![]() | assign | Assigns the source properties to this object. |
![]() | assignError | Raises an assignment error. |
![]() | assignTo | Assigns this object to another object. |
![]() | handleUndefinedProperty | Performs the error reporting for undefined properties. |
![]() | inSession | This method determines if this object exists in the current session. |
![]() | serialize | Stores this object into the session. |
![]() | unserialize | This method uses PHP reflection to iterate through published properties (those for which there is a getter method) and retrieve those stored by a previous call to serialize(). |
Defined in class Object |
||
![]() | __construct | Constructs an object and initializes its data before the object is first used. |
![]() | className | Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument). |
![]() | classNameIs | Determines whether an object is of a specific type. |
![]() | classParent | Returns the type of the immediate ancestor of a class. |
![]() | inheritsFrom | Determines the relationship of two object types. |
![]() | methodExists | Check if a method exists declared on this object instance. |
![]() | __get | To virtualize properties |
![]() | __set | To virtualize properties |
In an append operation, you define a brand new record, and then you add it to the dataset.
For example, imagine you have a dataset with the fields Name and Surname. This is how you would add a new record to it:
Now the dataset would have a new record for Jane Doe.
Any unsaved changes to the current record will be saved to the dataset upon calling this method. Imagine the following code was used instead of the four statements above:
Then the dataset would have two new records, one for John Doe and another one for Jane Doe.
You can use this feature to append records to the dataset in a loop like this:
If the dataset is closed, it raises an exception.
In an edit operation, you modify the data in the current record, and then update the dataset with those changes.
For example, imagine you have a dataset with the fields Name and Surname, and for those fields, the current record has the values 'Jane' and 'Doe' respectively. You could use this method to change the Name of the record:
Now the dataset record for Jane Doe would be replaced by a record for John Doe.
Any unsaved changes to the current record will be saved to the dataset upon calling this method.
Any unsaved changes to the current record will be saved to the dataset upon calling this method.
When you call first(), the Name of the current record is changed to 'Jane' in the dataset, and then the record cursor is moved to the first record.
In an insert operation, you define a new record by modifying the data in the current record, and then you add that new record to the dataset.
For example, imagine you have a dataset with the fields Name and Surname, and for those fields, the current record has the values 'Jane' and 'Doe' respectively. You could use this method to insert a new record in the dataset changing just the Name, and reusing the Surname of the current record:
Now the dataset would have both a record for Jane Doe and a record for John Doe.
Any unsaved changes to the current record will be saved to the dataset upon calling this method. Imagine the following code was used instead of the three statements above:
Then the dataset would have records for Jane Doe, John Doe and Jack Doe.
You can use this feature to insert records with values in common to the current record using a loop like this:
Any unsaved changes to the current record will be saved to the dataset upon calling this method.
When you call last(), the Name of the current record is changed to 'Jane' in the dataset, and then the record cursor is moved to the last record.
Overrides : Component::loaded() Initializes the component after the form file has been read into memory.
For example, if the current record of the dataset is the 6th:
The movement goes as far as it can. If you provide a number that would take the cursor to a position outside of the range of records, the cursor will be moved just until the limit (the first or the last record).
For example, if you are in the 10th of the 30 records the dataset has:
Any unsaved changes to the current record will be saved to the dataset upon calling this method.
When you call moveBy(), the Name of the current record is changed to 'Jane' in the dataset, and then the record cursor is moved the given positions.
Any unsaved changes to the current record will be saved to the dataset upon calling this method.
When you call next(), the Name of the current record is changed to 'Jane' in the dataset, and then the record cursor is moved to the next record.
Any unsaved changes to the current record will be saved to the dataset upon calling this method.
When you call prior(), the Name of the current record is changed to 'Jane' in the dataset, and then the record cursor is moved to the previous record.
Overrides : Persistent::serialize() Stores this object into the session.
Overrides : Persistent::unserialize() This method uses PHP reflection to iterate through published properties (those for which there is a getter method) and retrieve those stored by a previous call to serialize().
This method is called whenever the record cursor is moved to a different record, so the unsaved changes to the previously pointed record are ignored and replaced by those of the currently pointed record.
![]() | OnAfterCancel | Triggered once the unsaved changes to the current record have been successfully reverted. |
![]() | OnAfterClose | Triggered right after the dataset has been closed. |
![]() | OnAfterDelete | Triggered after a successful deletion of what was the current record. |
![]() | OnAfterEdit | Triggered after an edit operation has started. |
![]() | OnAfterInsert | Triggered after an insert or append operation has started. |
![]() | OnAfterOpen | Triggered right after the dataset has been opened. |
![]() | OnAfterPost | Triggered once the unsaved changes to the current record have been successfully saved to the dataset. |
![]() | OnBeforeCancel | Triggered when the unsaved changes to the current record are about to be reverted. |
![]() | OnBeforeClose | Triggered right before the dataset has been closed. |
![]() | OnBeforeDelete | Triggered when the current record is about to be deleted. |
![]() | OnBeforeEdit | Triggered when an edit operation is about to start. |
![]() | OnBeforeInsert | Triggered when an insert or append operation is about to start. |
![]() | OnBeforeOpen | Triggered right before the dataset is opened. |
![]() | OnBeforePost | Triggered when the unsaved changes to the current record are about to be saved to the dataset. |
![]() | OnDeleteError | Triggered whenever an error occurs while deleting the current record. |
![]() | OnNewRecord | Triggered once a new record has been added to the dataset (not to the underlying database). |
![]() | OnPostError | Triggered whenever an error occurs while saving to the dataset the unsaved changes to the current record. |
Defined in class Component |
||
![]() | OnAfterShow | Fires the Event after showing the control. |
![]() | OnBeforeShow | Fires the Event before showing the control. |
![]() | OnShow | Fires the Event at the same moment the control is shown. Some controls can prevent the control from being shown when this event is attached. |
The new record might have been added by starting either an append or an insert operation.
You may use this event to make some changes to the new record that will not count as a modification, so the record won't be commited to the underlying database unless it is further modified later, or you call completeTrans().