summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-21 11:08:04 +0100
committerSimon Rettberg2019-03-21 11:08:04 +0100
commit9072740bbe6ae62032ac4a22ec6f5c686a59c580 (patch)
treeb12b2f4d8fee8396ef11bb2307effbaa7468f288 /modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
parent[serversetup-bwlp-ipxe] Bootentry: add copy button & allow view only (diff)
downloadslx-admin-9072740bbe6ae62032ac4a22ec6f5c686a59c580.tar.gz
slx-admin-9072740bbe6ae62032ac4a22ec6f5c686a59c580.tar.xz
slx-admin-9072740bbe6ae62032ac4a22ec6f5c686a59c580.zip
[serversetup-bwlp-ipxe] Much better dup detection on import
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
index ee245e40..2353c0e9 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
@@ -90,6 +90,25 @@ abstract class BootEntry
return self::fromJson($row['data']);
}
+ /**
+ * Get all existing BootEntries from database, skipping those of
+ * unknown type. Returned array is assoc, key is entryid
+ *
+ * @return BootEntry[] all existing BootEntries
+ */
+ public static function getAll()
+ {
+ $res = Database::simpleQuery("SELECT entryid, data FROM serversetup_bootentry");
+ $ret = [];
+ while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ $tmp = self::fromJson($row['data']);
+ if ($tmp === null)
+ continue;
+ $ret[$row['entryid']] = $tmp;
+ }
+ return $ret;
+ }
+
}
class StandardBootEntry extends BootEntry
@@ -288,6 +307,7 @@ class MenuBootEntry extends BootEntry
public function __construct($menuId)
{
+ parent::__construct(false);
$this->menuId = $menuId;
}