icingaweb2-module-director/application/forms/IcingaServiceDictionaryMemberForm.php
Eric Lippmann b6af283732 License source files as GPL-3.0-or-later
Add SPDX license headers and mark source files as GPL-3.0-or-later to
preserve the option to relicense under later GPL versions.
2026-03-24 11:30:06 +01:00

57 lines
1.3 KiB
PHP

<?php
// SPDX-FileCopyrightText: 2021 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-3.0-or-later
namespace Icinga\Module\Director\Forms;
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
use Icinga\Module\Director\Objects\IcingaService;
class IcingaServiceDictionaryMemberForm extends DirectorObjectForm
{
/** @var IcingaService */
protected $object;
private $succeeded;
/**
* @throws \Zend_Form_Exception
*/
public function setup()
{
$this->addHidden('object_type', 'object');
$this->addElement('text', 'object_name', [
'label' => $this->translate('Name'),
'required' => !$this->object()->isApplyRule(),
'description' => $this->translate(
'Name for the instance you are going to create'
)
]);
$this->groupMainProperties()->setButtons();
}
protected function isNew()
{
return $this->object === null;
}
protected function deleteObject($object)
{
}
protected function getObjectClassname()
{
return IcingaService::class;
}
public function succeeded()
{
return $this->succeeded;
}
public function onSuccess()
{
$this->succeeded = true;
}
}