diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-10-03 17:12:53 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-10-03 17:12:53 -0300 |
commit | a3336da7dd92a2b8d31f2f33a6106a1802b5a387 (patch) | |
tree | 778908921605e91a9f79ed0ccfb9c341f5d09d3e /muamba.db.inc | |
parent | 60d116ff8a60bc98fb09e0bbf4afb2c37437353b (diff) | |
download | muamba-a3336da7dd92a2b8d31f2f33a6106a1802b5a387.tar.gz muamba-a3336da7dd92a2b8d31f2f33a6106a1802b5a387.tar.bz2 |
Starting to code muamba_accept()
Diffstat (limited to 'muamba.db.inc')
-rw-r--r-- | muamba.db.inc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/muamba.db.inc b/muamba.db.inc index 0e29ca6..e8e1c70 100644 --- a/muamba.db.inc +++ b/muamba.db.inc @@ -78,3 +78,29 @@ function muamba_get_transactions($uid, $type = 'sent', $status = NULL) { return $rows; } + +/** + * Get a single transaction. + * + * @param $mid + * Transaction id. + * + * @return + * Transaction data. + */ +function muamba_get_transaction($mid) { + $mid = (int) $mid; + $query = db_select('muamba', 'm'); + $query->fields('m', array('mid', 'nid', 'uid', 'owner', 'status', 'thread_id')); + $query->condition('m.mid', $mid, '='); + + $rows = array(); + $results = $query->execute()->fetchAll(); + + // Sanitize the data before handing it off to the theme layer. + foreach ($results as $entry) { + $rows[] = array_map('check_plain', (array) $entry); + } + + return $rows[0]; +} |