qqq
This commit is contained in:
+6
-3
@@ -508,13 +508,16 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array<array, array>
|
* @return array<array, array>
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function diff(): array
|
private function diff(): array
|
||||||
{
|
{
|
||||||
$changes = \array_diff_assoc($this->_attributes, $this->_oldAttributes);
|
$changes = \array_diff_assoc($this->_attributes, $this->_oldAttributes);
|
||||||
|
if ($this->hasPrimaryValue()) {
|
||||||
$condition = \array_intersect_assoc($this->_oldAttributes, $this->_attributes);
|
$condition = [$this->getPrimary() => $this->getPrimaryValue()];
|
||||||
|
} else {
|
||||||
|
$condition = \array_intersect_assoc($this->_oldAttributes, $this->_attributes);
|
||||||
|
}
|
||||||
return [$changes, $condition];
|
return [$changes, $condition];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user