PEAR Manual
Prev |  | Next

# Structures_DataGrid::addRecord()

Structures_DataGrid::addRecord() -- Adds a Structures_DataGrid_Record object to the DataGrid's record collection

## Synopsis

``mixed Structures_DataGrid::addRecord` (Structures_DataGrid_Record $record)`

## Description

This method is used to add a Structures_DataGrid_Record object to the DataGrid's Record Set. This is not the only method of getting data into the DataGrid. Commonly, the bind() method is used, unless you need to add individual records to the DataGrid. The Structures_DataGrid_Record object accepts an array of values. This method works best for looping through a result set from a database query or a XML or CSV data file.

## Parameter

object `$record`

  The record must be of type Structures_DataGrid_Record to be added to the DataGrid. Currently their are 2 other available record classes, a DB and a DB_DataObject record class, that exist in the package as well. This will allow you to extend the existing record class for a custom record driver.

## Return value

mixed - `TRUE` upon success otherwise a PEAR_Error upon failure.

## Note

The Structures_DataGrid package also includes 2 other Record classes. There is a class for both the PEAR::DB_Result and a PEAR::DB_DataObject classes to allow for easily adding individual records from these unique results.

Prev | Home | Next
Structures_DataGrid::addColumn() | Up | Structures_DataGrid::bind()