mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-08-15 23:08:11 +02:00
DbObject.php: forget autoinc on clone
This commit is contained in:
parent
5b853879b0
commit
1c395037c3
@ -517,6 +517,15 @@ abstract class DbObject
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function forgetAutoincId()
|
||||
{
|
||||
if (isset($this->properties[$this->autoincKeyName])) {
|
||||
$this->properties[$this->autoincKeyName] = null;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert das benutzte Datenbank-Handle
|
||||
*
|
||||
@ -876,7 +885,7 @@ abstract class DbObject
|
||||
public function __clone()
|
||||
{
|
||||
$this->onClone();
|
||||
$this->autoincKeyName = null;
|
||||
$this->forgetAutoincId();
|
||||
$this->loadedFromDb = false;
|
||||
$this->hasBeenModified = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user