mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-26 11:19:16 +02:00
DirectorObjectForm: prefill object with defaults
This commit is contained in:
parent
44154fe914
commit
2bab21c2d8
@ -23,6 +23,11 @@ abstract class DirectorObjectForm extends QuickForm
|
||||
if ($this->object === null) {
|
||||
$class = $this->getObjectClassname();
|
||||
$this->object = $class::create($values, $this->db);
|
||||
foreach ($this->getValues() as $key => $value) {
|
||||
if ($this->object->hasProperty($key)) {
|
||||
$this->object->$key = $value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (! $this->object->hasConnection()) {
|
||||
$this->object->setConnection($this->db);
|
||||
|
Loading…
x
Reference in New Issue
Block a user