From a3336da7dd92a2b8d31f2f33a6106a1802b5a387 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 3 Oct 2011 17:12:53 -0300 Subject: Starting to code muamba_accept() --- muamba.db.inc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'muamba.db.inc') 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]; +} -- cgit v1.2.3