Ferreteria/v0.3/class/tInternalStorage
< Ferreteria | v0.3 | class
Jump to navigation
Jump to search
/*----
CEMENTS: tSequentialAccess
NOTE: should probably be named tInternalSequentialStorage or similar
*/
trait tInternalStorage {
use tSequentialAccess;
private $arData = array();
private $idxData = -1;
// ++ DATA STATUS ++ //
/*----
RETURNS: number of rows in the resultset
*/
public function GetFoundRowCount() {
return count($this->arData);
}
// -- DATA STATUS -- //
// ++ DATA CONTROL ++ //
/*----
ACTION: sets the row pointer to just before the first row
*/
public function RewindRows() {
$this->idxData = -1;
}
// -- DATA CONTROL -- //
// ++ DATA READ ++ //
/*----
ACTION: Retrieves the current row data and advances to the next
RETURNS: row data as an array, or NULL if no more rows
CEMENT
*/
public function NextRow() {
$this->idxData++;
$idx = $this->idxData;
if (array_key_exists($idx,$this->arData)) {
$arRow = $this->arData[$idx];
$this->LoadRow_fromArray($arRow);
} else {
$arRow = NULL; // no more rows
}
return $arRow;
}
// -- DATA READ -- //
// ++ DATA WRITE ++ //
/*
HISTORY:
2018-11-09 disabled in tIOSource_internal because not sure if it was needed
2018-11-24 moved from tIOSource_internal to cIORow_internal because fcStackTrace needs it
*/
protected function SetAllRows(array $ar) {
$this->arData = $ar;
$this->RewindRows();
}
// -- DATA WRITE -- //
}
- file: Template:L/ferreteria/file
- uses: Template:L/ferreteria/class
- used by: Template:L/ferreteria/class