ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilXMLResultSetRow Class Reference

Row Class for XMLResultSet. More...

+ Collaboration diagram for ilXMLResultSetRow:

Public Member Functions

 setValue ($index, string $value)
 set column value More...
 
 getColumns ()
 
 setValues (array $values)
 Set values from array. More...
 
 getValue ($idx)
 Return value for column with specified index. More...
 

Private Attributes

array $columns = []
 

Detailed Description

Row Class for XMLResultSet.

Author
Roland Kuestermann (rku@a.nosp@m.ifb..nosp@m.uni-k.nosp@m.arls.nosp@m.ruhe..nosp@m.de)

Definition at line 29 of file class.ilXMLResultSetRow.php.

Member Function Documentation

◆ getColumns()

ilXMLResultSetRow::getColumns ( )
Returns
array<int|string, string>

Definition at line 48 of file class.ilXMLResultSetRow.php.

References $columns.

Referenced by ilXMLResultSetWriter\appendRow().

48  : array
49  {
50  return $this->columns;
51  }
+ Here is the caller graph for this function:

◆ getValue()

ilXMLResultSetRow::getValue (   $idx)

Return value for column with specified index.

Parameters
int | string$idx
Returns
string

Definition at line 69 of file class.ilXMLResultSetRow.php.

69  : string
70  {
71  if (is_string($idx) && !array_key_exists($idx, $this->columns)) {
72  throw new DomainException('Invalid index given: ' . $idx);
73  }
74 
75  if (is_int($idx) &&
76  ($idx < 0 || $idx >= count($this->columns))) {
77  throw new DomainException("Index too small or too large: " . $idx);
78  }
79 
80  return $this->columns[$idx];
81  }

◆ setValue()

ilXMLResultSetRow::setValue (   $index,
string  $value 
)

set column value

Parameters
int | string$index
string
Returns
void

Definition at line 40 of file class.ilXMLResultSetRow.php.

References $index.

Referenced by setValues().

40  : void
41  {
42  $this->columns[$index] = $value;
43  }
$index
Definition: metadata.php:145
+ Here is the caller graph for this function:

◆ setValues()

ilXMLResultSetRow::setValues ( array  $values)

Set values from array.

Definition at line 56 of file class.ilXMLResultSetRow.php.

References $i, and setValue().

56  : void
57  {
58  $i = 0;
59  foreach ($values as $value) {
60  $this->setValue($i++, (string) $value);
61  }
62  }
setValue($index, string $value)
set column value
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

Field Documentation

◆ $columns

array ilXMLResultSetRow::$columns = []
private

Definition at line 32 of file class.ilXMLResultSetRow.php.

Referenced by getColumns().


The documentation for this class was generated from the following file: