diff --git a/Base/Model.php b/Base/Model.php index ba04a82..14c6ed2 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -223,10 +223,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T */ public function getPrimaryValue(): ?int { - if ($this->hasPrimary()) { - return $this->getAttribute($this->getPrimary()); - } - return null; + return $this->_oldAttributes[$this->getPrimary()] ?? null; } /**