Skip to content

Commit fdd3791

Browse files
committed
fix
1 parent c6e104e commit fdd3791

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

LeanMapperQuery/Query.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,10 @@ public function applyQuery(Fluent $fluent, IMapper $mapper, QueryTarget\ITarget
492492
private function apply(Fluent $fluent, IMapper $mapper, $sourceTableName = null)
493493
{
494494
if ($this->hash !== null) {
495-
$sum = hash_final($this->hash);
495+
$h = hash_copy($this->hash);
496+
$sum = hash_final($h);
496497
if (array_key_exists($sum, self::$fluentCache)) {
497-
return self::$fluentCache[$sum];
498+
return clone self::$fluentCache[$sum];
498499
}
499500
}
500501

@@ -552,8 +553,8 @@ private function apply(Fluent $fluent, IMapper $mapper, $sourceTableName = null)
552553
call_user_func_array([$this, $method], $args);
553554
}
554555

555-
if ($this->hash !== null) {
556-
self::$fluentCache[$sum] = $fluent;
556+
if (isset($sum)) {
557+
self::$fluentCache[$sum] = clone $fluent;
557558
}
558559

559560
// Reset fluent.

0 commit comments

Comments
 (0)