Skip to content

Commit 09528a6

Browse files
committed
Remove cross-version patch for renamed methods
3e26e05
1 parent f14204f commit 09528a6

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

src/Eloquent/HybridRelations.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -324,20 +324,6 @@ public function belongsToMany(
324324
);
325325
}
326326

327-
/**
328-
* Get the relationship name of the belongs to many.
329-
*
330-
* @return string
331-
*/
332-
protected function guessBelongsToManyRelation()
333-
{
334-
if (method_exists($this, 'getBelongsToManyCaller')) {
335-
return $this->getBelongsToManyCaller();
336-
}
337-
338-
return parent::guessBelongsToManyRelation();
339-
}
340-
341327
/** @inheritdoc */
342328
public function newEloquentBuilder($query)
343329
{

src/Relations/BelongsToMany.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function sync($ids, $detaching = true)
123123
// First we need to attach any of the associated models that are not currently
124124
// in this joining table. We'll spin through the given IDs, checking to see
125125
// if they exist in the array of current ones, and if not we will insert.
126-
$current = $this->parent->{$this->getRelatedKey()} ?: [];
126+
$current = $this->parent->{$this->relatedPivotKey} ?: [];
127127

128128
// See issue #256.
129129
if ($current instanceof Collection) {
@@ -196,7 +196,7 @@ public function attach($id, array $attributes = [], $touch = true)
196196
}
197197

198198
// Attach the new ids to the parent model.
199-
$this->parent->push($this->getRelatedKey(), (array) $id, true);
199+
$this->parent->push($this->relatedPivotKey, (array) $id, true);
200200

201201
if (! $touch) {
202202
return;
@@ -220,7 +220,7 @@ public function detach($ids = [], $touch = true)
220220
$ids = (array) $ids;
221221

222222
// Detach all ids from the parent model.
223-
$this->parent->pull($this->getRelatedKey(), $ids);
223+
$this->parent->pull($this->relatedPivotKey, $ids);
224224

225225
// Prepare the query to select all related objects.
226226
if (count($ids) > 0) {
@@ -316,16 +316,6 @@ protected function formatSyncList(array $records)
316316
return $results;
317317
}
318318

319-
/**
320-
* Get the related key with backwards compatible support.
321-
*
322-
* @return string
323-
*/
324-
public function getRelatedKey()
325-
{
326-
return property_exists($this, 'relatedPivotKey') ? $this->relatedPivotKey : $this->relatedKey;
327-
}
328-
329319
/**
330320
* Get the name of the "where in" method for eager loading.
331321
*

0 commit comments

Comments
 (0)