1 <?php declare(strict_types=1);
25 include_once
'./webservice/soap/classes/class.ilXMLResultSetColumn.php';
26 include_once
'./webservice/soap/classes/class.ilXMLResultSetRow.php';
41 if ($index < 0 || $index > count($this->colspecs)) {
50 public function addColumn(
string $columnname) : void
61 foreach ($this->colspecs as $colspec) {
62 if (strcasecmp($columnname, $colspec->getName()) === 0) {
73 public function hasColumn(
string $columnname) : bool
122 public function addArray(array $array,
bool $overwrite =
false) : void
127 foreach ($array as $row) {
130 $columnNames = array_keys($row);
131 foreach ($columnNames as $columnName) {
137 $xmlRow->setValues($row);
144 $this->rows = array();
145 $this->colspecs = array();
150 return count($this->colspecs);
155 return count($this->rows);
166 return $this->rows[$idx];
175 public function getValue(
int $rowIdx, $colIdx) : string
177 $row = $this->
getRow($rowIdx);
179 if (!is_numeric($colIdx)) {
182 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)