IcingaServiceSetForm: improve readability

This commit is contained in:
Thomas Gelf 2016-12-16 13:33:54 +01:00
parent 018629aad0
commit 726b320d24
1 changed files with 5 additions and 3 deletions

View File

@ -3,7 +3,7 @@
namespace Icinga\Module\Director\Forms; namespace Icinga\Module\Director\Forms;
use Icinga\Module\Director\Objects\IcingaHost; use Icinga\Module\Director\Objects\IcingaHost;
use Icinga\Module\Director\Objects\IcingaService; use Icinga\Module\Director\Objects\IcingaServiceSet;
use Icinga\Module\Director\Web\Form\DirectorObjectForm; use Icinga\Module\Director\Web\Form\DirectorObjectForm;
class IcingaServiceSetForm extends DirectorObjectForm class IcingaServiceSetForm extends DirectorObjectForm
@ -26,6 +26,7 @@ class IcingaServiceSetForm extends DirectorObjectForm
protected function setupFields() protected function setupFields()
{ {
/** @var IcingaServiceSet $object */
$object = $this->object(); $object = $this->object();
$this->assertResolvedImports(); $this->assertResolvedImports();
@ -61,14 +62,15 @@ class IcingaServiceSetForm extends DirectorObjectForm
{ {
$object = $this->object(); $object = $this->object();
if ($this->hasBeenSent()) { if ($this->hasBeenSent()) {
$object->object_name = $object->imports = $this->getSentValue('imports'); $object->set('object_name', $this->getSentValue('imports'));
$object->set('imports', $object->object_name);
} }
if (! $object->hasBeenLoadedFromDb()) { if (! $object->hasBeenLoadedFromDb()) {
$this->addSingleImportsElement(); $this->addSingleImportsElement();
} }
if (count($object->imports)) { if (count($object->get('imports'))) {
$this->addHtmlHint( $this->addHtmlHint(
$this->getView()->escape( $this->getView()->escape(
$object->getResolvedProperty('description') $object->getResolvedProperty('description')