1 | <?php declare(strict_types=1); |
||
17 | final class RowSearchResult |
||
18 | { |
||
19 | /** @var FieldSearchResult[] */ |
||
20 | private $fieldMatchList = []; |
||
21 | |||
22 | /** @var null|ColumnMetadata */ |
||
23 | private $primaryKeyColumn; |
||
24 | |||
25 | /** @var mixed|null */ |
||
26 | private $primaryKeyValue; |
||
27 | |||
28 | /** @var TableMetadata */ |
||
29 | private $tableMetadata; |
||
30 | |||
31 | |||
32 | /** |
||
33 | * @param TableMetadata $tableMetadata |
||
34 | * @param FieldSearchResult[] $fieldMatchList |
||
35 | * @param ColumnMetadata|null $primaryKeyColumn |
||
36 | * @param mixed|null $primaryKeyValue |
||
37 | */ |
||
38 | 3 | public function __construct( |
|
51 | |||
52 | public function getTableMetadata(): TableMetadata |
||
56 | |||
57 | /** |
||
58 | * Get array of matching columns in this row. |
||
59 | * |
||
60 | * @return FieldSearchResult[] |
||
61 | */ |
||
62 | 1 | public function getMatchingFields(): array |
|
66 | |||
67 | /** |
||
68 | * Returns true if the column result exists. |
||
69 | */ |
||
70 | 3 | public function hasColumnResult(string $columnName): bool |
|
74 | |||
75 | /** |
||
76 | * Returns the column result matching the passed name. |
||
77 | */ |
||
78 | 2 | public function getColumnResult(string $columnName): FieldSearchResult |
|
86 | |||
87 | /** |
||
88 | * Returns the primary key column's metadata. |
||
89 | * |
||
90 | * @throws \RuntimeException If the result doesn't have a primary key |
||
91 | */ |
||
92 | 1 | public function getPrimaryKeyColumn(): ?ColumnMetadata |
|
96 | |||
97 | /** |
||
98 | * Returns the primary key value. |
||
99 | * |
||
100 | * @throws \RuntimeException If the result doesn't have a primary key |
||
101 | * @return mixed|null |
||
102 | */ |
||
103 | 1 | public function getPrimaryKeyValue() |
|
107 | } |