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