summaryrefslogtreecommitdiff
path: root/classes/labels.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-21 09:35:07 +0300
committerAndrew Dolgov <[email protected]>2021-02-21 09:35:07 +0300
commit94560132ddf45a5a7c68ce520b40ecb10a6f89fe (patch)
treea973158db213849936eab2805681b7908d6034fa /classes/labels.php
parentb4e96374bcc14b3be353f87a80f83b34615dec73 (diff)
for the most part, deal with filter rules UI
Diffstat (limited to 'classes/labels.php')
-rw-r--r--classes/labels.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/classes/labels.php b/classes/labels.php
index f72d7d84b..570f24f4f 100644
--- a/classes/labels.php
+++ b/classes/labels.php
@@ -37,7 +37,18 @@ class Labels
}
}
- static function get_all_labels($owner_uid) {
+ static function get_as_hash($owner_uid) {
+ $rv = [];
+ $labels = Labels::get_all($owner_uid);
+
+ foreach ($labels as $i => $label) {
+ $rv[$label["id"]] = $labels[$i];
+ }
+
+ return $rv;
+ }
+
+ static function get_all($owner_uid) {
$rv = array();
$pdo = Db::pdo();
@@ -46,7 +57,7 @@ class Labels
WHERE owner_uid = ? ORDER BY caption");
$sth->execute([$owner_uid]);
- while ($line = $sth->fetch()) {
+ while ($line = $sth->fetch(PDO::FETCH_ASSOC)) {
array_push($rv, $line);
}