File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public function performInsert(Model $model)
52
52
}
53
53
54
54
// Push the new model to the database.
55
- $ result = $ this ->getBaseQuery ()->push ($ this ->localKey , $ model ->getAttributes (), true );
55
+ $ result = $ this ->toBase ()->push ($ this ->localKey , $ model ->getAttributes (), true );
56
56
57
57
// Attach the model to its parent.
58
58
if ($ result ) {
@@ -83,7 +83,7 @@ public function performUpdate(Model $model)
83
83
$ values = $ this ->getUpdateValues ($ model ->getDirty (), $ this ->localKey .'.$. ' );
84
84
85
85
// Update document in database.
86
- $ result = $ this ->getBaseQuery ()->where ($ this ->localKey .'. ' .$ model ->getKeyName (), $ foreignKey )
86
+ $ result = $ this ->toBase ()->where ($ this ->localKey .'. ' .$ model ->getKeyName (), $ foreignKey )
87
87
->update ($ values );
88
88
89
89
// Attach the model to its parent.
@@ -112,7 +112,7 @@ public function performDelete(Model $model)
112
112
// Get the correct foreign key value.
113
113
$ foreignKey = $ this ->getForeignKeyValue ($ model );
114
114
115
- $ result = $ this ->getBaseQuery ()->pull ($ this ->localKey , [$ model ->getKeyName () => $ foreignKey ]);
115
+ $ result = $ this ->toBase ()->pull ($ this ->localKey , [$ model ->getKeyName () => $ foreignKey ]);
116
116
117
117
if ($ result ) {
118
118
$ this ->dissociate ($ model );
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public function performInsert(Model $model)
50
50
return $ this ->parent ->save () ? $ model : false ;
51
51
}
52
52
53
- $ result = $ this ->getBaseQuery ()->update ([$ this ->localKey => $ model ->getAttributes ()]);
53
+ $ result = $ this ->toBase ()->update ([$ this ->localKey => $ model ->getAttributes ()]);
54
54
55
55
// Attach the model to its parent.
56
56
if ($ result ) {
@@ -76,7 +76,7 @@ public function performUpdate(Model $model)
76
76
77
77
$ values = $ this ->getUpdateValues ($ model ->getDirty (), $ this ->localKey .'. ' );
78
78
79
- $ result = $ this ->getBaseQuery ()->update ($ values );
79
+ $ result = $ this ->toBase ()->update ($ values );
80
80
81
81
// Attach the model to its parent.
82
82
if ($ result ) {
@@ -101,7 +101,7 @@ public function performDelete()
101
101
}
102
102
103
103
// Overwrite the local key with an empty array.
104
- $ result = $ this ->getBaseQuery ()->update ([$ this ->localKey => null ]);
104
+ $ result = $ this ->toBase ()->update ([$ this ->localKey => null ]);
105
105
106
106
// Detach the model from its parent.
107
107
if ($ result ) {
Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ protected function getForeignKeyValue($id)
246
246
}
247
247
248
248
// Convert the id to MongoId if necessary.
249
- return $ this ->getBaseQuery ()->convertKey ($ id );
249
+ return $ this ->toBase ()->convertKey ($ id );
250
250
}
251
251
252
252
/**
@@ -322,7 +322,7 @@ public function getQuery()
322
322
/**
323
323
* @inheritdoc
324
324
*/
325
- public function getBaseQuery ()
325
+ public function toBase ()
326
326
{
327
327
// Because we are sharing this relation instance to models, we need
328
328
// to make sure we use separate query instances.
You can’t perform that action at this time.
0 commit comments