From f66ab8dae2f3d0418759f81a3a64dc9517a62449 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 15:17:31 +0200 Subject: Adding upstream version 1.10.2. Signed-off-by: Daniel Baumann --- application/forms/BasketCreateSnapshotForm.php | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 application/forms/BasketCreateSnapshotForm.php (limited to 'application/forms/BasketCreateSnapshotForm.php') diff --git a/application/forms/BasketCreateSnapshotForm.php b/application/forms/BasketCreateSnapshotForm.php new file mode 100644 index 0000000..165c7ac --- /dev/null +++ b/application/forms/BasketCreateSnapshotForm.php @@ -0,0 +1,37 @@ +basket = $basket; + + return $this; + } + + public function setup() + { + $this->setSubmitLabel($this->translate('Create Snapshot')); + } + + /** + * @throws \Icinga\Module\Director\Exception\DuplicateKeyException + */ + public function onSuccess() + { + /** @var \Icinga\Module\Director\Db $connection */ + $connection = $this->basket->getConnection(); + $snapshot = BasketSnapshot::createForBasket($this->basket, $connection); + $snapshot->store(); + parent::onSuccess(); + } +} -- cgit v1.2.3