From e5453807f271e4664bd954cfea67d77f925ab2f0 Mon Sep 17 00:00:00 2001 From: xl Date: Thu, 5 Sep 2024 15:42:24 +0800 Subject: [PATCH] eee --- Base/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Base/Model.php b/Base/Model.php index 1467a02..9c5801a 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -223,8 +223,8 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, \ */ public function getPrimaryValue(): ?int { - if ($this->hasPrimary()) { - return (int)$this->_oldAttributes[$this->getPrimary()] ?? null; + if ($this->hasPrimary() && isset($this->_oldAttributes[$this->getPrimary()])) { + return (int)$this->_oldAttributes[$this->getPrimary()]; } else { return null; }