1: | <?php |
2: | |
3: | namespace Baril\Orderly\Relations; |
4: | |
5: | use Illuminate\Database\Eloquent\Builder; |
6: | use Illuminate\Database\Eloquent\Model; |
7: | use Illuminate\Database\Eloquent\Relations\BelongsToMany; |
8: | |
9: | |
10: | |
11: | |
12: | class BelongsToManyOrderable extends BelongsToMany |
13: | { |
14: | use Concerns\InteractsWithOrderablePivotTable; |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | |
22: | |
23: | |
24: | |
25: | |
26: | |
27: | |
28: | |
29: | |
30: | public function __construct( |
31: | Builder $query, |
32: | Model $parent, |
33: | $orderColumn, |
34: | $table, |
35: | $foreignPivotKey, |
36: | $relatedPivotKey, |
37: | $parentKey, |
38: | $relatedKey, |
39: | $relationName = null |
40: | ) { |
41: | parent::__construct( |
42: | $query, |
43: | $parent, |
44: | $table, |
45: | $foreignPivotKey, |
46: | $relatedPivotKey, |
47: | $parentKey, |
48: | $relatedKey, |
49: | $relationName |
50: | ); |
51: | $this->setOrderColumn($orderColumn); |
52: | } |
53: | } |
54: | |