Conditions | 4 |
Paths | 4 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | protected function lookupKey( |
||
26 | int $key, |
||
27 | RecordInterface $record, |
||
28 | ContextualCommandInterface $command = null |
||
29 | ) { |
||
30 | $key = $this->key($key); |
||
31 | |||
32 | if (!empty($command)) { |
||
33 | $context = $command->getContext(); |
||
34 | if (!empty($context[$key])) { |
||
35 | //Key value found in a context |
||
36 | return $context[$key]; |
||
37 | } |
||
38 | |||
39 | if ($key == $this->primaryColumnOf($record)) { |
||
40 | return $command->primaryKey(); |
||
41 | } |
||
42 | } |
||
43 | |||
44 | //Fallback lookup in a record |
||
45 | return $record->getField($key, null); |
||
46 | } |
||
47 | |||
65 | } |