Skip to content

Commit 2db2b77

Browse files
committed
Removing unused methods
1 parent 56bbdea commit 2db2b77

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

src/Mixins/JoinRelationship.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class JoinRelationship
4141
public function joinRelationship()
4242
{
4343
return function ($relationName, $callback = null, $joinType = 'join', $useAlias = false) {
44-
$useAlias = $this->shouldUseAlias($useAlias);
4544
$joinType = JoinRelationship::$joinMethodsMap[$joinType] ?? $joinType;
4645

4746
if (is_null($this->getSelect())) {
@@ -343,23 +342,13 @@ public function newPowerJoinClause()
343342
};
344343
}
345344

346-
/**
347-
* Check if the current join should use aliases.
348-
*/
349-
public function shouldUseAlias()
350-
{
351-
return function ($shouldUseAlias) {
352-
return $shouldUseAlias;
353-
};
354-
}
355-
356345
public function generateAliasForRelationship()
357346
{
358347
return function ($relation, $relationName) {
359348
if ($relation instanceof BelongsToMany || $relation instanceof HasManyThrough) {
360349
return [
361-
md5($relationName.'table1'.time()),
362-
md5($relationName.'table2' . time()),
350+
md5($relationName.'table1'.time()),
351+
md5($relationName.'table2'.time()),
363352
];
364353
}
365354

@@ -384,12 +373,8 @@ public function clearPowerJoinCaches()
384373
{
385374
return function () {
386375
JoinRelationship::$powerJoinAliasesCache = [];
376+
387377
return $this;
388378
};
389379
}
390-
391-
public static function getAliasFor($model = null, $default = null)
392-
{
393-
return JoinRelationship::$powerJoinAliasesCache[spl_object_id($model)] ?? $default;
394-
}
395380
}

src/Mixins/RelationshipsExtraMethods.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function getFarParent()
271271
public function getTableOrAliasForModel()
272272
{
273273
return function ($model, $default = null) {
274-
return JoinRelationship::getAliasFor($model, $default);
274+
return JoinRelationship::$powerJoinAliasesCache[spl_object_id($model)] ?? $default;
275275
};
276276
}
277277
}

0 commit comments

Comments
 (0)