function setRecord($data) { if (strtolower(is_subclass_of($data, 'db_dataobject'))) { parent::setRecord($data->toArray()); } else { return new PEAR_Error('Invalid data type. ' . 'Data must be of type DB_DataObject'); } }
/** * Set Record * * Converts the DB_Record object into a format that the DataGrid object * understands. * * @access public * @param object DB_Result $data The DB_Result object. */ function setRecord($data) { if (strtolower(get_class($data)) == 'db_result') { parent::setRecord($data->fetchRow(DB_FETCHMODE_ASSOC)); } else { return new PEAR_Error('Invalid data type. Data must be a DB_Result record'); } }