We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e0c02a commit 47059b2Copy full SHA for 47059b2
src/Temporal.php
@@ -129,9 +129,11 @@ protected function endCurrent()
129
*/
130
private function getQuery()
131
{
132
- $query = $this
133
- ->where($this->primaryKey, '!=', $this->{$this->primaryKey})
134
- ->where($this->temporalParentColumn, $this->{$this->temporalParentColumn});
+ $query = $this->where($this->temporalParentColumn, $this->{$this->temporalParentColumn});
+
+ if ($this->{$this->primaryKey}) {
135
+ $query->where($this->primaryKey, '!=', $this->{$this->primaryKey});
136
+ }
137
138
if ($this->temporalPolymorphicTypeColumn) {
139
$query->where($this->temporalPolymorphicTypeColumn, $this->{$this->temporalPolymorphicTypeColumn});
0 commit comments