ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilXMLResultSetRow.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
28 private array $columns = [];
29
36 public function setValue($index, string $value): void
37 {
38 $this->columns[$index] = $value;
39 }
40
44 public function getColumns(): array
45 {
46 return $this->columns;
47 }
48
52 public function setValues(array $values): void
53 {
54 $i = 0;
55 foreach ($values as $value) {
56 $this->setValue($i++, (string) $value);
57 }
58 }
59
65 public function getValue($idx): 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 }
78}
Row Class for XMLResultSet.
setValues(array $values)
Set values from array.
setValue($index, string $value)
set column value
getValue($idx)
Return value for column with specified index.