From 02daf8b97a1c5e08e5d87c381cd1af81f6c124a1 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 2 Aug 2015 15:07:41 +0200 Subject: [PATCH] DirectorObjectForm: allow to set object externally --- library/Director/Web/Form/DirectorObjectForm.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/Director/Web/Form/DirectorObjectForm.php b/library/Director/Web/Form/DirectorObjectForm.php index 0f7b0a1c..82c5c9d4 100644 --- a/library/Director/Web/Form/DirectorObjectForm.php +++ b/library/Director/Web/Form/DirectorObjectForm.php @@ -372,6 +372,16 @@ abstract class DirectorObjectForm extends QuickForm return $this->object; } + public function setObject(IcingaObject $object) + { + $this->object = $object; + if ($this->db === null) { + $this->setDb($db); + } + + return $this; + } + protected function getObjectClassname() { if ($this->className === null) {