Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
56 | public function toRecord(BaseModel $model, bool $mirrorScenario = true): Record |
||
57 | { |
||
58 | |||
59 | if (!$record = $this->findRecordByModel($model)) { |
||
60 | // Create new record |
||
61 | $record = $this->createRecord(); |
||
62 | } |
||
63 | |||
64 | // Populate the record attributes |
||
65 | $this->transferToRecord($model, $record, $mirrorScenario); |
||
66 | |||
67 | return $record; |
||
68 | } |
||
69 | } |
||
70 |