3 declare(strict_types=1);
27 include_once
'./webservice/soap/classes/class.ilXMLResultSetColumn.php';
28 include_once
'./webservice/soap/classes/class.ilXMLResultSetRow.php';
43 if ($index < 0 || $index > count($this->colspecs)) {
63 foreach ($this->colspecs as $colspec) {
64 if (strcasecmp($columnname, $colspec->getName()) === 0) {
100 $this->rows[] = $row;
124 public function addArray(array $array,
bool $overwrite =
false): void
129 foreach ($array as $row) {
132 $columnNames = array_keys($row);
133 foreach ($columnNames as $columnName) {
139 $xmlRow->setValues($row);
146 $this->rows = array();
147 $this->colspecs = array();
152 return count($this->colspecs);
157 return count($this->rows);
168 return $this->rows[$idx];
177 public function getValue(
int $rowIdx, $colIdx): string
179 $row = $this->
getRow($rowIdx);
181 if (!is_numeric($colIdx)) {
184 return $row->getValue($colIdx);
addArray(array $array, bool $overwrite=false)
Add table values.
Row Class for XMLResultSet.
addColumn(string $columnname)
create a new column with columnname and attach it to column list
getColumnName(int $index)
getColSpecs()
return array of ilXMLResultSetColumn
getValue(int $rowIdx, $colIdx)
return column value at colidx and rowidx
Column Class for XMLResultSet.
getRow($idx)
return row for index idx
getIndexForColumn(string $columnname)
return index for column name
setArray(array $array)
Clear table value and sets them based on array.
hasColumn(string $columnname)
has column name
getRows()
return array of ilXMLResultSetRow
addRow(ilXMLResultSetRow $row)