Compare commits

...

1 Commits

Author SHA1 Message Date
as2252258 e5453807f2 eee 2024-09-05 15:42:24 +08:00
+2 -2
View File
@@ -223,8 +223,8 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, \
*/ */
public function getPrimaryValue(): ?int public function getPrimaryValue(): ?int
{ {
if ($this->hasPrimary()) { if ($this->hasPrimary() && isset($this->_oldAttributes[$this->getPrimary()])) {
return (int)$this->_oldAttributes[$this->getPrimary()] ?? null; return (int)$this->_oldAttributes[$this->getPrimary()];
} else { } else {
return null; return null;
} }