summaryrefslogtreecommitdiffstats
path: root/app/class/object.class.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-06-04 22:28:09 -0400
committerMalf Furious <m@lfurio.us>2017-06-04 22:28:09 -0400
commit2376aabe74528b018189982224d61a643325b114 (patch)
tree3aa16bc3dd40b1a7dd1a1f524d71a6c16055e716 /app/class/object.class.php
parent6b69e5a8f85ebdf92b84e3330bea306d4a90a115 (diff)
parenta8e79321426b1436f46ba5b7c5dee390c94bdb8b (diff)
downloadscrott-2376aabe74528b018189982224d61a643325b114.tar.gz
scrott-2376aabe74528b018189982224d61a643325b114.zip
Merge branch 'feature/mesgs' into dev
Diffstat (limited to '')
-rw-r--r--app/class/object.class.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php
index 7c80b5b..461f1b1 100644
--- a/app/class/object.class.php
+++ b/app/class/object.class.php
@@ -163,6 +163,24 @@ class object extends table
}
/*
+ * Get all messages on this object. Messages are sorted by date
+ * created.
+ */
+ public function getMesgs_ordByDatetime() : array
+ {
+ $query = "SELECT guid FROM objects WHERE objtype = 'mesg' AND " .
+ "parent = '" . database::esc($this->guid) . "' ORDER BY created";
+ $res = database::query($query);
+
+ $mesgs = array();
+
+ foreach ($res as $m)
+ $mesgs[] = new mesg($m['guid']);
+
+ return $mesgs;
+ }
+
+ /*
* Get the URL to the head image resource for this object
*/
public function getHeadImg() : string