@@ -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}
0 commit comments