ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Row.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23class Row implements RowInterface
24{
25 protected int $id;
26 protected string $table;
27
31 protected array $data;
32
33 public function __construct(
34 int $id,
35 string $table,
37 ) {
38 $this->id = $id;
39 $this->table = $table;
40 $this->data = $data;
41 }
42
43 public function id(): int
44 {
45 return $this->id;
46 }
47
48 public function table(): string
49 {
50 return $this->table;
51 }
52
53 public function value(string $field): string
54 {
55 foreach ($this->data as $datum) {
56 if ($datum->name() === $field) {
57 return $datum->value();
58 }
59 }
60 return '';
61 }
62}
__construct(int $id, string $table, FieldInterface ... $data)
Definition: Row.php:33