cvs: pearweb /include/notes ManualNotes.class.php
| From: | David Coallier | Date: | Fri, 23 Mar 2007 16:31:23 +0000 |
| Subject: | cvs: pearweb /include/notes ManualNotes.class.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-45378@lists.php.net to get a copy of this message | ||
davidc Fri Mar 23 16:31:23 2007 UTC
Modified files:
/pearweb/include/notes ManualNotes.class.php
Log:
- Added getSingleCommentById function
http://cvs.php.net/viewvc.cgi/pearweb/include/notes/ManualNotes.class.php?r1=1.12&r2=1.13&diff_format=u
Index: pearweb/include/notes/ManualNotes.class.php
diff -u pearweb/include/notes/ManualNotes.class.php:1.12
pearweb/include/notes/ManualNotes.class.php:1.13
--- pearweb/include/notes/ManualNotes.class.php:1.12 Thu Mar 22 23:49:17 2007
+++ pearweb/include/notes/ManualNotes.class.php Fri Mar 23 16:31:23 2007
@@ -139,7 +139,35 @@
SET note_compiled=? WHERE note_id=?', array($compiled, $id));
}
}
+ // {{{ public function getSingleCommentById
+ /**
+ * Get a single comment by id
+ *
+ * This function will retrieve the single
+ * comment's information by note_id.
+ *
+ * @access public
+ * @param integer $noteId The note id to retrieve
+ * @return mixed $res Error on query fail and associative
+ * array on success.
+ */
+ function getSingleCommentById($noteId)
+ {
+ $sql = "
+ SELECT note_id, page_url, user_name, user_handle,
+ note_compiled as note_text, note_time, note_approved,
+ note_approved_by, note_deleted
+ FROM {$this->notesTableName}
+ WHERE note_id = ?";
+ $res = $this->dbc->getRow($sql, array($noteId), DB_FETCHMODE_ASSOC);
+ if (PEAR::isError($res)) {
+ return $res;
+ }
+
+ return $res;
+ }
+ // }}}
// {{{ public function getPageComments
/**
* Get Page Comments