Skip to content

Commit 22a9719

Browse files
committed
optional original result
1 parent 534925c commit 22a9719

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Repository.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,13 @@ private function addDefaultValues(Entity $instance): Entity
476476
return $instance;
477477
}
478478

479-
public function getOriginal(Entity $instance): array
479+
public function getOriginal(Entity $instance): ?array
480480
{
481-
return $this->original[$this->space->getInstanceKey($instance)];
481+
$key = $this->space->getInstanceKey($instance);
482+
483+
if (array_key_exists($key, $this->original)) {
484+
return $this->original[$key];
485+
}
482486
}
483487

484488
private function getTuple(Entity $instance): array

0 commit comments

Comments
 (0)