summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-11-05 03:10:32 -0500
committerMalf Furious <m@lfurio.us>2018-11-05 03:10:32 -0500
commit81ba021468e38de09ac292115bb2f15c9d4deec0 (patch)
tree859ae0d3d550611e73a0e94a47152f6529222644
parented8ad6bd4d4e0d389bb95632d08b6c97e85284a4 (diff)
downloadscrott-81ba021468e38de09ac292115bb2f15c9d4deec0.tar.gz
scrott-81ba021468e38de09ac292115bb2f15c9d4deec0.zip
Add function pad::getClosedIssues_ordByClosed()
This returns an array of all issues which directly parent the pad object. These are the pad's closed issues. Most recently closed issues are first in the array. Signed-off-by: Malf Furious <m@lfurio.us>
-rw-r--r--app/class/pad.class.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/class/pad.class.php b/app/class/pad.class.php
index dcf2b32..0c69385 100644
--- a/app/class/pad.class.php
+++ b/app/class/pad.class.php
@@ -108,6 +108,24 @@ class pad extends obj
$stage->saveObj();
$this->saveObj();
}
+
+ /*
+ * Get an array of all closed issues under this pad. Ordered by
+ * datetime closed.
+ */
+ public function getClosedIssues_ordByClosed() : array
+ {
+ $query = "SELECT o.guid FROM objects o JOIN issues i ON o.guid = i.guid " .
+ "WHERE o.parent = '" . database::esc($this->guid) . "' ORDER BY i.closed DESC";
+ $res = database::query($query);
+
+ $issues = array();
+
+ foreach ($res as $i)
+ $issues[] = new issue($i['guid']);
+
+ return $issues;
+ }
}
?>