ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 31 of file class.ilXMLResultSetRow.php.

Member Function Documentation

◆ getColumns()

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

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

References $columns.

Referenced by ilXMLResultSetWriter\appendRow().

50  : array
51  {
52  return $this->columns;
53  }
+ 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 71 of file class.ilXMLResultSetRow.php.

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

◆ setValue()

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

set column value

Parameters
int | string$index
string
Returns
void

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

Referenced by setValues().

42  : void
43  {
44  $this->columns[$index] = $value;
45  }
+ Here is the caller graph for this function:

◆ setValues()

ilXMLResultSetRow::setValues ( array  $values)

Set values from array.

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

References setValue().

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

Field Documentation

◆ $columns

array ilXMLResultSetRow::$columns = []
private

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

Referenced by getColumns().


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