10
10
use Illuminate \Database \Eloquent \Relations \BelongsToMany as EloquentBelongsToMany ;
11
11
use Illuminate \Support \Arr ;
12
12
use MongoDB \Laravel \Eloquent \Model as DocumentModel ;
13
+ use Override ;
13
14
14
15
use function array_diff ;
15
16
use function array_keys ;
@@ -39,12 +40,14 @@ public function getHasCompareKey()
39
40
}
40
41
41
42
/** @inheritdoc */
43
+ #[Override]
42
44
public function getRelationExistenceQuery (Builder $ query , Builder $ parentQuery , $ columns = ['* ' ])
43
45
{
44
46
return $ query ;
45
47
}
46
48
47
49
/** @inheritdoc */
50
+ #[Override]
48
51
protected function hydratePivotRelation (array $ models )
49
52
{
50
53
// Do nothing.
@@ -61,12 +64,14 @@ protected function getSelectColumns(array $columns = ['*'])
61
64
}
62
65
63
66
/** @inheritdoc */
67
+ #[Override]
64
68
protected function shouldSelect (array $ columns = ['* ' ])
65
69
{
66
70
return $ columns ;
67
71
}
68
72
69
73
/** @inheritdoc */
74
+ #[Override]
70
75
public function addConstraints ()
71
76
{
72
77
if (static ::$ constraints ) {
@@ -89,6 +94,7 @@ protected function setWhere()
89
94
}
90
95
91
96
/** @inheritdoc */
97
+ #[Override]
92
98
public function save (Model $ model , array $ pivotAttributes = [], $ touch = true )
93
99
{
94
100
$ model ->save (['touch ' => false ]);
@@ -99,6 +105,7 @@ public function save(Model $model, array $pivotAttributes = [], $touch = true)
99
105
}
100
106
101
107
/** @inheritdoc */
108
+ #[Override]
102
109
public function create (array $ attributes = [], array $ joining = [], $ touch = true )
103
110
{
104
111
$ instance = $ this ->related ->newInstance ($ attributes );
@@ -114,6 +121,7 @@ public function create(array $attributes = [], array $joining = [], $touch = tru
114
121
}
115
122
116
123
/** @inheritdoc */
124
+ #[Override]
117
125
public function sync ($ ids , $ detaching = true )
118
126
{
119
127
$ changes = [
@@ -177,13 +185,15 @@ public function sync($ids, $detaching = true)
177
185
}
178
186
179
187
/** @inheritdoc */
188
+ #[Override]
180
189
public function updateExistingPivot ($ id , array $ attributes , $ touch = true )
181
190
{
182
191
// Do nothing, we have no pivot table.
183
192
return $ this ;
184
193
}
185
194
186
195
/** @inheritdoc */
196
+ #[Override]
187
197
public function attach ($ id , array $ attributes = [], $ touch = true )
188
198
{
189
199
if ($ id instanceof Model) {
@@ -224,6 +234,7 @@ public function attach($id, array $attributes = [], $touch = true)
224
234
}
225
235
226
236
/** @inheritdoc */
237
+ #[Override]
227
238
public function detach ($ ids = [], $ touch = true )
228
239
{
229
240
if ($ ids instanceof Model) {
@@ -264,6 +275,7 @@ public function detach($ids = [], $touch = true)
264
275
}
265
276
266
277
/** @inheritdoc */
278
+ #[Override]
267
279
protected function buildDictionary (Collection $ results )
268
280
{
269
281
$ foreign = $ this ->foreignPivotKey ;
@@ -283,6 +295,7 @@ protected function buildDictionary(Collection $results)
283
295
}
284
296
285
297
/** @inheritdoc */
298
+ #[Override]
286
299
public function newPivotQuery ()
287
300
{
288
301
return $ this ->newRelatedQuery ();
@@ -309,12 +322,14 @@ public function getForeignKey()
309
322
}
310
323
311
324
/** @inheritdoc */
325
+ #[Override]
312
326
public function getQualifiedForeignPivotKeyName ()
313
327
{
314
328
return $ this ->foreignPivotKey ;
315
329
}
316
330
317
331
/** @inheritdoc */
332
+ #[Override]
318
333
public function getQualifiedRelatedPivotKeyName ()
319
334
{
320
335
return $ this ->relatedPivotKey ;
@@ -323,10 +338,9 @@ public function getQualifiedRelatedPivotKeyName()
323
338
/**
324
339
* Get the name of the "where in" method for eager loading.
325
340
*
326
- * @param string $key
327
- *
328
- * @return string
341
+ * @inheritdoc
329
342
*/
343
+ #[Override]
330
344
protected function whereInMethod (Model $ model , $ key )
331
345
{
332
346
return 'whereIn ' ;
0 commit comments