DirectorObjectForm: use autoinc for ints

This commit is contained in:
Thomas Gelf 2018-10-04 06:54:49 +02:00
parent 8d61fa6347
commit ac0745445e
1 changed files with 5 additions and 1 deletions

View File

@ -990,7 +990,11 @@ abstract class DirectorObjectForm extends DirectorForm
{
/** @var DbObject $class */
$class = $this->getObjectClassname();
$this->object = $class::load($id, $this->db);
if (is_int($id)) {
$this->object = $class::loadWithAutoIncId($id, $this->db);
} else {
$this->object = $class::load($id, $this->db);
}
// TODO: hmmmm...
if (! is_array($id) && $this->object->getKeyName() === 'id') {