Skip to content

Commit 6aa6ad1

Browse files
authored
Merge pull request #2263 from divine/fix-getrelation
[3.8] Fix getRelationQuery breaking changes
2 parents a9b432b + 924c285 commit 6aa6ad1

File tree

3 files changed

+1
-76
lines changed

3 files changed

+1
-76
lines changed

Diff for: src/Relations/HasMany.php

-38
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ public function getForeignKeyName()
1717
return $this->foreignKey;
1818
}
1919

20-
/**
21-
* Get the plain foreign key.
22-
* @return string
23-
*/
24-
public function getPlainForeignKey()
25-
{
26-
return $this->getForeignKeyName();
27-
}
28-
2920
/**
3021
* Get the key for comparing against the parent key in "has" query.
3122
* @return string
@@ -45,35 +36,6 @@ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery,
4536
return $query->select($foreignKey)->where($foreignKey, 'exists', true);
4637
}
4738

48-
/**
49-
* Add the constraints for a relationship count query.
50-
* @param Builder $query
51-
* @param Builder $parent
52-
* @return Builder
53-
*/
54-
public function getRelationCountQuery(Builder $query, Builder $parent)
55-
{
56-
$foreignKey = $this->getHasCompareKey();
57-
58-
return $query->select($foreignKey)->where($foreignKey, 'exists', true);
59-
}
60-
61-
/**
62-
* Add the constraints for a relationship query.
63-
* @param Builder $query
64-
* @param Builder $parent
65-
* @param array|mixed $columns
66-
* @return Builder
67-
*/
68-
public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*'])
69-
{
70-
$query->select($columns);
71-
72-
$key = $this->wrap($this->getQualifiedParentKeyName());
73-
74-
return $query->where($this->getHasCompareKey(), 'exists', true);
75-
}
76-
7739
/**
7840
* Get the name of the "where in" method for eager loading.
7941
* @param \Illuminate\Database\Eloquent\Model $model

Diff for: src/Relations/HasOne.php

-38
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ public function getHasCompareKey()
2626
return $this->getForeignKeyName();
2727
}
2828

29-
/**
30-
* Get the plain foreign key.
31-
* @return string
32-
*/
33-
public function getPlainForeignKey()
34-
{
35-
return $this->getForeignKeyName();
36-
}
37-
3829
/**
3930
* @inheritdoc
4031
*/
@@ -45,35 +36,6 @@ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery,
4536
return $query->select($foreignKey)->where($foreignKey, 'exists', true);
4637
}
4738

48-
/**
49-
* Add the constraints for a relationship count query.
50-
* @param Builder $query
51-
* @param Builder $parent
52-
* @return Builder
53-
*/
54-
public function getRelationCountQuery(Builder $query, Builder $parent)
55-
{
56-
$foreignKey = $this->getForeignKeyName();
57-
58-
return $query->select($foreignKey)->where($foreignKey, 'exists', true);
59-
}
60-
61-
/**
62-
* Add the constraints for a relationship query.
63-
* @param Builder $query
64-
* @param Builder $parent
65-
* @param array|mixed $columns
66-
* @return Builder
67-
*/
68-
public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*'])
69-
{
70-
$query->select($columns);
71-
72-
$key = $this->wrap($this->getQualifiedParentKeyName());
73-
74-
return $query->where($this->getForeignKeyName(), 'exists', true);
75-
}
76-
7739
/**
7840
* Get the name of the "where in" method for eager loading.
7941
* @param \Illuminate\Database\Eloquent\Model $model

Diff for: tests/QueueTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function testQueueJobLifeCycle(): void
3939
'job' => 'test',
4040
'maxTries' => null,
4141
'maxExceptions' => null,
42+
'failOnTimeout' => false,
4243
'backoff' => null,
4344
'timeout' => null,
4445
'data' => ['action' => 'QueueJobLifeCycle'],

0 commit comments

Comments
 (0)