Ferreteria/v0.3/class/tSequentialAccess

From Woozle Writes Code
< Ferreteria‎ | v0.3‎ | class
Revision as of 00:46, 29 December 2018 by htyp>Woozle (Created page with "{{page/code/class|ferreteria}} <source lang=php> /*tttt PURPOSE: for enabling sequential access to multiple rows of data Does not implement a method of storing the data....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Page/code/class

/*tttt
  PURPOSE: for enabling sequential access to multiple rows of data
    Does not implement a method of storing the data.
*/
trait tSequentialAccess {
    // ACTION: sets the row pointer to just before the first row
    abstract public function RewindRows();
    // RETURNS: number of rows in the resultset
    abstract public function GetFoundRowCount();
    public function IsRowFound() { return ($this->GetFoundRowCount() > 0); }
    /*----
      ACTION: Retrieves the current row data and advances to the next
      RETURNS: row data as an array, or NULL if no more rows
    */
    abstract public function NextRow();   // load the next row from the source into the fields
    /*----
      ACTION: For each record in the current record source, the field values
	are added to an array which is keyed by the given field.
      INPUT: $sField = name of field to use as the array key
      RETURNS: keyed array of field objects
        array[key][field name] = field object
    */
    public function FetchRows_asFieldArray($sField) {
    // ASSUMES: all rows have the same columns
    public function DumpRows() {
}