DbObject.php: forget autoinc on clone
This commit is contained in:
parent
5b853879b0
commit
1c395037c3
|
@ -517,6 +517,15 @@ abstract class DbObject
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function forgetAutoincId()
|
||||||
|
{
|
||||||
|
if (isset($this->properties[$this->autoincKeyName])) {
|
||||||
|
$this->properties[$this->autoincKeyName] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liefert das benutzte Datenbank-Handle
|
* Liefert das benutzte Datenbank-Handle
|
||||||
*
|
*
|
||||||
|
@ -876,7 +885,7 @@ abstract class DbObject
|
||||||
public function __clone()
|
public function __clone()
|
||||||
{
|
{
|
||||||
$this->onClone();
|
$this->onClone();
|
||||||
$this->autoincKeyName = null;
|
$this->forgetAutoincId();
|
||||||
$this->loadedFromDb = false;
|
$this->loadedFromDb = false;
|
||||||
$this->hasBeenModified = true;
|
$this->hasBeenModified = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue