Solutions Open Source

Référence de la classe ADORecordSet

Graphe d'héritage de ADORecordSet:

Inheritance graph
[légende]
Graphe de collaboration de ADORecordSet:

Collaboration graph
[légende]

Liste de tous les membres

Fonctions membres publiques

 ADORecordSet ($queryID)
 Init ()
 GetMenu ($name, $defstr='', $blank1stItem=true, $multiple=false, $size=0, $selectAttr='', $compareFields0=true)
 GetMenu2 ($name, $defstr='', $blank1stItem=true, $multiple=false, $size=0, $selectAttr='')
 GetMenu3 ($name, $defstr='', $blank1stItem=true, $multiple=false, $size=0, $selectAttr='')
GetArray ($nRows=-1)
GetAll ($nRows=-1)
 NextRecordSet ()
GetArrayLimit ($nrows, $offset=-1)
GetRows ($nRows=-1)
GetAssoc ($force_array=false, $first2cols=false)
 UserTimeStamp ($v, $fmt='Y-m-d H:i:s')
 UserDate ($v, $fmt='Y-m-d')
 UnixDate ($v)
 UnixTimeStamp ($v)
 Free ()
 NumRows ()
 NumCols ()
FetchRow ()
 FetchInto (&$arr)
 MoveFirst ()
 MoveLast ()
 MoveNext ()
 Move ($rowNumber=0)
 Fields ($colname)
 GetAssocKeys ($upper=true)
GetRowAssoc ($upper=1)
 Close ()
 RecordCount ()
 MaxRecordCount ()
 RowCount ()
 PO_RecordCount ($table="", $condition="")
 CurrentRow ()
 AbsolutePosition ()
 FieldCount ()
FetchField ($fieldoffset)
FieldTypesArray ()
FetchObj ()
FetchObject ($isupper=true)
FetchNextObj ()
FetchNextObject ($isupper=true)
 MetaType ($t, $len=-1, $fieldobj=false)
 _close ()
 AbsolutePage ($page=-1)
 AtFirstPage ($status=false)
 LastPageNo ($page=false)
 AtLastPage ($status=false)

Attributs publics

 $dataProvider = "native"
 $fields = false
 $blobSize = 100
 holds the current row data
 $canSeek = false
 in other words, we use a text area for editing.
 $sql
 indicates that seek is supported
 $EOF = false
 sql text
 $emptyTimeStamp = ' '
 Indicates that the current record position is after the last record in a Recordset object.
 $emptyDate = ' '
 what to display when $time==0
 $debug = false
 what to display when $time==0
 $timeCreated = 0
 $bind = false
 datetime in Unix format rs created -- for cached recordsets
 $fetchMode
 used by Fields() to hold array - should be private?
 $connection = false
 default fetch mode
 $_numOfRows = -1
 the parent connection
 $_numOfFields = -1
 $_queryID = -1
 $_currentRow = -1
 $_closed = false
 $_inited = false
 $_obj
 $_names
 $_currentPage = -1
 $_atFirstPage = false
 $_atLastPage = false
 $_lastPageNo = -1
 $_maxRecordCount = 0
 $datetime = false


Description détaillée

RecordSet class that represents the dataset returned by the database. To keep memory overhead low, this class holds only the current row in memory. No prefetching of data is done, so the RecordCount() can return -1 ( which means recordcount not known).

Documentation des fonctions membres

ADORecordSet::ADORecordSet ( queryID  ) 

Constructor

Paramètres:
queryID this is the queryID returned by ADOConnection->_query()

ADORecordSet::Init (  ) 

Réimplémentée dans ADORecordset_oci8, et ADORecordSet_pdo.

ADORecordSet::GetMenu ( name,
defstr = '',
blank1stItem = true,
multiple = false,
size = 0,
selectAttr = '',
compareFields0 = true 
)

Generate a SELECT tag string from a recordset, and return the string. If the recordset has 2 cols, we treat the 1st col as the containing the text to display to the user, and 2nd col as the return value. Default strings are compared with the FIRST column.

Paramètres:
name name of SELECT tag
[defstr] the value to hilite. Use an array for multiple hilites for listbox.
[blank1stItem] true to leave the 1st item in list empty
[multiple] true for listbox, false for popup
[size] rows to show for listbox. not used by popup
[selectAttr] additional attributes to defined for SELECT tag. useful for holding javascript onChange='...' handlers. &
[compareFields0] when we have 2 cols in recordset, we compare the defstr with column 0 (1st col) if this is true. This is not documented.
Renvoie:
HTML
changes by glen.davies@cce.ac.nz to support multiple hilited items

ADORecordSet::GetMenu2 ( name,
defstr = '',
blank1stItem = true,
multiple = false,
size = 0,
selectAttr = '' 
)

Generate a SELECT tag string from a recordset, and return the string. If the recordset has 2 cols, we treat the 1st col as the containing the text to display to the user, and 2nd col as the return value. Default strings are compared with the SECOND column.

ADORecordSet::GetMenu3 ( name,
defstr = '',
blank1stItem = true,
multiple = false,
size = 0,
selectAttr = '' 
)

& ADORecordSet::GetArray ( nRows = -1  ) 

return recordset as a 2-dimensional array.

Paramètres:
[nRows] is the number of rows to return. -1 means every row.
Renvoie:
an array indexed by the rows (0-based) from the recordset

Réimplémentée dans ADORecordSet_array.

& ADORecordSet::GetAll ( nRows = -1  ) 

ADORecordSet::NextRecordSet (  ) 

Réimplémentée dans ADORecordSet_ado, ADORecordSet_ado, et ADORecordSet_odbtp.

& ADORecordSet::GetArrayLimit ( nrows,
offset = -1 
)

return recordset as a 2-dimensional array. Helper function for ADOConnection->SelectLimit()

Paramètres:
offset is the row to start calculations from (1-based)
[nrows] is the number of rows to return
Renvoie:
an array indexed by the rows (0-based) from the recordset

Réimplémentée dans ADORecordSet_db2, ADORecordset_oci8, ADORecordset_oci8po, et ADORecordSet_odbc.

& ADORecordSet::GetRows ( nRows = -1  ) 

Synonym for GetArray() for compatibility with ADO.

Paramètres:
[nRows] is the number of rows to return. -1 means every row.
Renvoie:
an array indexed by the rows (0-based) from the recordset

& ADORecordSet::GetAssoc ( force_array = false,
first2cols = false 
)

return whole recordset as a 2-dimensional associative array if there are more than 2 columns. The first column is treated as the key and is not included in the array. If there is only 2 columns, it will return a 1 dimensional array of key-value pairs unless $force_array == true.

Paramètres:
[force_array] has only meaning if we have 2 data columns. If false, a 1 dimensional array is returned, otherwise a 2 dimensional array is returned. If this sounds confusing, read the source.
[first2cols] means if there are more than 2 cols, ignore the remaining cols and instead of returning array[col0] => array(remaining cols), return array[col0] => col1
Renvoie:
an associative array indexed by the first column of the array, or false if the data has less than 2 cols.

Réimplémentée dans ADORecordSet_ldap.

ADORecordSet::UserTimeStamp ( v,
fmt = 'Y-m-d H:i:s' 
)

Paramètres:
v is the character timestamp in YYYY-MM-DD hh:mm:ss format
fmt is the format to apply to it, using date()
Renvoie:
a timestamp formated as user desires

ADORecordSet::UserDate ( v,
fmt = 'Y-m-d' 
)

Paramètres:
v is the character date in YYYY-MM-DD format, returned by database
fmt is the format to apply to it, using date()
Renvoie:
a date formated as user desires

ADORecordSet::UnixDate ( v  ) 

Paramètres:
$v is a date string in YYYY-MM-DD format
Renvoie:
date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format

Réimplémentée dans ADORecordset_sybase, et ADORecordSet_array_sybase.

ADORecordSet::UnixTimeStamp ( v  ) 

Paramètres:
$v is a timestamp string in YYYY-MM-DD HH-NN-SS format
Renvoie:
date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format

Réimplémentée dans ADORecordset_sybase, et ADORecordSet_array_sybase.

ADORecordSet::Free (  ) 

PEAR DB Compat - do not use internally

ADORecordSet::NumRows (  ) 

PEAR DB compat, number of rows

ADORecordSet::NumCols (  ) 

PEAR DB compat, number of cols

& ADORecordSet::FetchRow (  ) 

Fetch a row, returning false if no more rows. This is PEAR DB compat mode.

Renvoie:
false or array containing the current record

ADORecordSet::FetchInto ( &$  arr  ) 

Fetch a row, returning PEAR_Error if no more rows. This is PEAR DB compat mode.

Renvoie:
DB_OK or error object

ADORecordSet::MoveFirst (  ) 

Move to the first row in the recordset. Many databases do NOT support this.

Renvoie:
true or false

Réimplémentée dans ADORecordset_informix72, et ADORecordSet_odbtp.

ADORecordSet::MoveLast (  ) 

Move to the last row in the recordset.

Renvoie:
true or false

Réimplémentée dans ADORecordset_informix72, et ADORecordSet_odbtp.

ADORecordSet::MoveNext (  ) 

Move to next record in the recordset.

Renvoie:
true if there still rows available, or false if there are no more rows (EOF).

Réimplémentée dans ADORecordSet_array, ADORecordSet_db2, ADORecordSet_mysql, ADORecordSet_ext_mysql, ADORecordSet_mysqli, ADORecordSet_mysqlt, ADORecordSet_ext_mysqlt, ADORecordset_oci8, ADORecordset_oci8po, ADORecordSet_odbc, ADORecordSet_postgres64, ADORecordSet_postgres7, et ADORecordSet_assoc_postgres7.

ADORecordSet::Move ( rowNumber = 0  ) 

Random access to a specific row in the recordset. Some databases do not support access to previous rows in the databases (no scrolling backwards).

Paramètres:
rowNumber is the row to move to (0-based)
Renvoie:
true if there still rows available, or false if there are no more rows (EOF).

ADORecordSet::Fields ( colname  ) 

Get the value of a field in the current row by column name. Will not work if ADODB_FETCH_MODE is set to ADODB_FETCH_NUM.

Paramètres:
colname is the field to access
Renvoie:
the value of $colname column

Réimplémentée dans ADORecordSet_array, ADORecordSet_ado, ADORecordSet_ado, ADORecordSet_db2, ADORecordset_ibase, ADORecordSet_mysql, ADORecordSet_mysqli, ADORecordset_oci8, ADORecordset_oci8po, ADORecordSet_odbc, ADORecordset_oracle, ADORecordSet_pdo, ADORecordSet_postgres64, et ADORecordset_sqlite.

ADORecordSet::GetAssocKeys ( upper = true  ) 

& ADORecordSet::GetRowAssoc ( upper = 1  ) 

Use associative array to get fields array for databases that do not support associative arrays. Submitted by Paolo S. Asioli paolo.asioli::libero.it

If you don't want uppercase cols, set $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC before you execute your SQL statement, and access $rs->fields['col'] directly.

$upper 0 = lowercase, 1 = uppercase, 2 = whatever is returned by FetchField

Réimplémentée dans ADORecordSet_mysql, ADORecordSet_mysqli, et ADORecordSet_postgres64.

ADORecordSet::Close (  ) 

Clean up recordset

Renvoie:
true or false

ADORecordSet::RecordCount (  ) 

synonyms RecordCount and RowCount

Renvoie:
the number of rows or -1 if this is not supported

ADORecordSet::MaxRecordCount (  ) 

ADORecordSet::RowCount (  ) 

synonyms RecordCount and RowCount

Renvoie:
the number of rows or -1 if this is not supported

ADORecordSet::PO_RecordCount ( table = "",
condition = "" 
)

Portable RecordCount. Pablo Roca <pabloroca@mvps.org>

Renvoie:
the number of records from a previous SELECT. All databases support this.
But aware possible problems in multiuser environments. For better speed the table must be indexed by the condition. Heavy test this before deploying.

ADORecordSet::CurrentRow (  ) 

Renvoie:
the current row in the recordset. If at EOF, will return the last row. 0-based.

ADORecordSet::AbsolutePosition (  ) 

synonym for CurrentRow -- for ADO compat

Renvoie:
the current row in the recordset. If at EOF, will return the last row. 0-based.

ADORecordSet::FieldCount (  ) 

Renvoie:
the number of columns in the recordset. Some databases will set this to 0 if no records are returned, others will return the number of columns in the query.

& ADORecordSet::FetchField ( fieldoffset  ) 

Get the ADOFieldObject of a specific column.

Paramètres:
fieldoffset is the column position to access(0-based).
Renvoie:
the ADOFieldObject for that column, or false.

Réimplémentée dans ADORecordSet_array, ADORecordSet_ado, ADORecordSet_ado, ADORecordSet_db2, ADORecordSet_fbsql, ADORecordset_ibase, ADORecordset_informix72, ADORecordSet_mysql, ADORecordSet_mysqli, ADORecordset_oci8, ADORecordSet_odbc, ADORecordSet_odbtp, ADORecordset_oracle, ADORecordSet_pdo, ADORecordSet_postgres64, ADORecordset_sqlite, et ADORecordset_sybase.

& ADORecordSet::FieldTypesArray (  ) 

Get the ADOFieldObjects of all columns in an array.

& ADORecordSet::FetchObj (  ) 

Return the fields array of the current row as an object for convenience. The default case is lowercase field names.

Renvoie:
the object with the properties set to the fields of the current row

& ADORecordSet::FetchObject ( isupper = true  ) 

Return the fields array of the current row as an object for convenience. The default case is uppercase.

Paramètres:
$isupper to set the object property names to uppercase
Renvoie:
the object with the properties set to the fields of the current row

& ADORecordSet::FetchNextObj (  ) 

Return the fields array of the current row as an object for convenience. The default is lower-case field names.

Renvoie:
the object with the properties set to the fields of the current row, or false if EOF
Fixed bug reported by tim@orotech.net

& ADORecordSet::FetchNextObject ( isupper = true  ) 

Return the fields array of the current row as an object for convenience. The default is upper case field names.

Paramètres:
$isupper to set the object property names to uppercase
Renvoie:
the object with the properties set to the fields of the current row, or false if EOF
Fixed bug reported by tim@orotech.net

ADORecordSet::MetaType ( t,
len = -1,
fieldobj = false 
)

Get the metatype of the column. This is used for formatting. This is because many databases use different names for the same type, so we transform the original type to our standardised version which uses 1 character codes:

Paramètres:
t is the type passed in. Normally is ADOFieldObject->type.
len is the maximum length of that field. This is because we treat character fields bigger than a certain size as a 'B' (blob).
fieldobj is the field object returned by the database driver. Can hold additional info (eg. primary_key for mysql).
Renvoie:
the general type of the data: C for character < 250 chars X for teXt (>= 250 chars) B for Binary N for numeric or floating point D for date T for timestamp L for logical/Boolean I for integer R for autoincrement counter/integer

Réimplémentée dans ADORecordSet_ado, ADORecordSet_ado, ADORecordSet_fbsql, ADORecordset_ibase, ADORecordSet_mysql, ADORecordSet_mysqli, ADORecordSet_odbc_db2, et ADORecordSet_postgres64.

ADORecordSet::_close (  ) 

Réimplémentée dans ADORecordSet_array, ADORecordSet_ado, ADORecordSet_ado, ADORecordSet_db2, ADORecordSet_fbsql, ADORecordset_ibase, ADORecordset_informix72, ADORecordSet_ldap, ADORecordSet_mysql, ADORecordSet_mysqli, ADORecordset_oci8, ADORecordSet_odbc, ADORecordSet_odbtp, ADORecordset_oracle, ADORecordSet_pdo, ADORecordSet_postgres64, ADORecordset_sqlite, et ADORecordset_sybase.

ADORecordSet::AbsolutePage ( page = -1  ) 

set/returns the current recordset page when paginating

ADORecordSet::AtFirstPage ( status = false  ) 

set/returns the status of the atFirstPage flag when paginating

ADORecordSet::LastPageNo ( page = false  ) 

ADORecordSet::AtLastPage ( status = false  ) 

set/returns the status of the atLastPage flag when paginating


Documentation des données membres

ADORecordSet::$dataProvider = "native"

Réimplémentée dans ADORecordSet_ado, ADORecordSet_db2, ADORecordSet_odbc, et ADORecordSet_pdo.

ADORecordSet::$fields = false

ADORecordSet::$blobSize = 100

holds the current row data

ADORecordSet::$canSeek = false

in other words, we use a text area for editing.

any varchar/char field this size or greater is treated as a blob

Réimplémentée dans ADORecordSet_array, ADORecordSet_ado, ADORecordSet_fbsql, ADORecordset_informix72, ADORecordSet_ldap, ADORecordSet_mysql, ADORecordSet_mysqli, ADORecordSet_netezza, ADORecordSet_odbtp, ADORecordSet_postgres64, et ADORecordset_sybase.

ADORecordSet::$sql

indicates that seek is supported

Réimplémentée dans ADORecordSet_array.

ADORecordSet::$EOF = false

sql text

ADORecordSet::$emptyTimeStamp = '&nbsp;'

Indicates that the current record position is after the last record in a Recordset object.

ADORecordSet::$emptyDate = '&nbsp;'

what to display when $time==0

ADORecordSet::$debug = false

what to display when $time==0

ADORecordSet::$timeCreated = 0

ADORecordSet::$bind = false

datetime in Unix format rs created -- for cached recordsets

Réimplémentée dans ADORecordSet_ado, ADORecordSet_db2, ADORecordset_ibase, ADORecordset_oci8, ADORecordSet_odbc, ADORecordset_oracle, ADORecordSet_pdo, et ADORecordset_sqlite.

ADORecordSet::$fetchMode

used by Fields() to hold array - should be private?

ADORecordSet::$connection = false

default fetch mode

ADORecordSet::$_numOfRows = -1

the parent connection

ADORecordSet::$_numOfFields = -1

number of rows, or -1

ADORecordSet::$_queryID = -1

number of fields in recordset

ADORecordSet::$_currentRow = -1

This variable keeps the result link identifier.

ADORecordSet::$_closed = false

This variable keeps the current row in the Recordset.

ADORecordSet::$_inited = false

has recordset been closed

ADORecordSet::$_obj

Init() should only be called once

ADORecordSet::$_names

Used by FetchObj

ADORecordSet::$_currentPage = -1

Used by FetchObj

ADORecordSet::$_atFirstPage = false

Added by Iván Oliva to implement recordset pagination

ADORecordSet::$_atLastPage = false

Added by Iván Oliva to implement recordset pagination

ADORecordSet::$_lastPageNo = -1

Added by Iván Oliva to implement recordset pagination

ADORecordSet::$_maxRecordCount = 0

ADORecordSet::$datetime = false


La documentation de cette classe a été générée à partir du fichier suivant :
Généré le Fri Aug 31 11:40:13 2007 pour OBLADY - Typo3 API v4.1.2 par  doxygen 1.5.3