Total Complexity | 4 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 83.33% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | trait Chronos |
||
15 | { |
||
16 | use ChronosRelations; |
||
17 | use ChronosTimestamps; |
||
18 | |||
19 | /** |
||
20 | * Create a new pivot model instance. |
||
21 | * |
||
22 | * @param \Illuminate\Database\Eloquent\Model $parent |
||
23 | * @param array $attributes |
||
24 | * @param string $table |
||
25 | * @param bool $exists |
||
26 | * @param string|null $using |
||
27 | * @return \Cino\LaravelChronos\Eloquent\Relations\Pivot |
||
28 | */ |
||
29 | 1 | public function newPivot(BaseModel $parent, array $attributes, $table, $exists, $using = null) |
|
30 | { |
||
31 | 1 | return $using ? $using::fromRawAttributes($parent, $attributes, $table, $exists) |
|
32 | 1 | : Pivot::fromAttributes($parent, $attributes, $table, $exists); |
|
33 | } |
||
34 | |||
35 | /** |
||
36 | * Reload the current model instance with fresh attributes from the database. |
||
37 | * |
||
38 | * @return \Illuminate\Database\Eloquent\Model |
||
39 | */ |
||
40 | 1 | public function refresh() |
|
57 | } |
||
58 | } |
||
59 |