public function getOldPrimaryKey($asArray = false)
{
$pk = static::primaryKey()[0];
if ($this->getIsNewRecord()) {
$id = null;
} elseif ($pk == '_id') {
$id = $this->_id;
} else {
$id = $this->getOldAttribute($pk);
}
if ($asArray) {
return [$pk => $id];
} else {
return $id;
}
}