ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 25 of file class.ilXMLResultSetRow.php.

Member Function Documentation

◆ getColumns()

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

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

References $columns.

Referenced by ilXMLResultSetWriter\appendRow().

44  : array
45  {
46  return $this->columns;
47  }
+ 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 65 of file class.ilXMLResultSetRow.php.

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

◆ setValue()

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

set column value

Parameters
int | string$index
string
Returns
void

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

Referenced by setValues().

36  : void
37  {
38  $this->columns[$index] = $value;
39  }
+ Here is the caller graph for this function:

◆ setValues()

ilXMLResultSetRow::setValues ( array  $values)

Set values from array.

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

References setValue().

52  : void
53  {
54  $i = 0;
55  foreach ($values as $value) {
56  $this->setValue($i++, (string) $value);
57  }
58  }
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 28 of file class.ilXMLResultSetRow.php.

Referenced by getColumns().


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