Skip to content

Commit 8594ee1

Browse files
committed
stop cloning in EntityQueryType to avoid cached description
1 parent ed1214f commit 8594ee1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Type/EntityQuery/EntityQueryType.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ public function hasAccessCheck(): bool
1717

1818
public function withAccessCheck(): self
1919
{
20-
$type = clone $this;
20+
$type = new self(
21+
$this->getClassName(),
22+
$this->getSubtractedType(),
23+
$this->getClassReflection()
24+
);
2125
$type->hasAccessCheck = true;
22-
2326
return $type;
2427
}
2528

2629
protected function describeAdditionalCacheKey(): string
2730
{
28-
return $this->hasAccessCheck ? 'with-access-check' : '';
31+
return $this->hasAccessCheck ? 'with-access-check' : 'without-access-check';
2932
}
3033
}

0 commit comments

Comments
 (0)