diff --git a/src/Drivers/SQL/SQLExpression.php b/src/Drivers/SQL/SQLExpression.php index 463bea1e8..3adeb812f 100644 --- a/src/Drivers/SQL/SQLExpression.php +++ b/src/Drivers/SQL/SQLExpression.php @@ -1319,10 +1319,10 @@ protected function lambdaExpression(Lambda $node): void $field = $this->entitySet->propertyToExpression($constraint->getProperty()); - $relation = $constraint?->relation; + $relation = $constraint->getRelation(); if (isset($relation) && $relation instanceof HasManyThrough) { - $constraint->relation->select($relation->getQualifiedFirstKeyName()); - $where = preg_replace('/\s+where\s+.*$/i', '', $constraint->relation->toSql()); + $constraint->getRelation()->select($relation->getQualifiedFirstKeyName()); + $where = preg_replace('/\s+where\s+.*$/i', '', $constraint->getRelation()->toSql()); $this->pushStatement( sprintf('( %s = %s ( %s WHERE', $field->getStatement(),