Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | protected function formatAttachRecord($key, $value, $attributes, $hasTimestamps) |
||
19 | { |
||
20 | [$id, $attributes] = $this->extractAttachIdAndAttributes($key, $value, $attributes); |
||
21 | |||
22 | /** |
||
23 | * When attaching multiple models with pivot data PHP will cast a numeric-string array key to an integer |
||
24 | * By setting the type here we recast it to the keyType set on the model. |
||
25 | */ |
||
26 | settype($id, $this->related->getKeyType()); |
||
27 | |||
28 | return array_merge( |
||
29 | $this->baseAttachRecord($id, $hasTimestamps), |
||
|
|||
30 | $this->castAttributes($attributes) |
||
31 | ); |
||
34 |