Class UserComment

Index Home MAE > MAE Architecture > MAE Data Types > Class Index > Class UserComment

Summary
Public Methods
UserComment(id)
UserComment(data)
UserComment()
void clear()
inline bool valid() const
inline DbRecNum getId() const
inline DbRecNum getUserId() const
inline string getTitle() const
inline string getCommentType() const
inline bool isBug() const
inline bool isFeature() const
inline bool isComment() const
inline string getComment() const
inline time_t getPostTime() const
inline time_t getReplyTime() const
inline DbRecNum getReplyUserId() const
inline time_t getResolveTime() const
inline DbRecNum getResolveUserId() const
inline int getSeverity() const
inline int getPriority() const
inline UserComment& setUserId(newUserId)
inline UserComment& setTitle(newTitle)
inline UserComment& setTypeBug()
inline UserComment& setTypeFeature()
inline UserComment& setTypeComment()
inline UserComment& setComment(newComment)
inline UserComment& setPostTime(newPostTime)
inline UserComment& setReplyTime(newReplyTime)
inline UserComment& setReplyUserId(newReplyUserId)
inline UserComment& setResolveTime(newResolveTime)
inline UserComment& setResolveUserId(newResolveUserId)
inline UserComment& setSeverity(newSeverity)
inline UserComment& setPriority(newPriority)
void set(data)
HashArray toHashArray(forDB) const
inline XMLData toXML(forDB) const
DbRecNum save()
Protected Methods
bool load(id)
Private Properties
Private Methods
static bool initdb()
DbRecNum append()
inline void setCommentType(newCommentType)
See Also

#include <UserComment.h >

Summary

Class to manage comments contributed by users.  Comments fall into one of these categories:

Public Methods

UserComment(id)

DbRecNum id

db table record id; 0 for empty record


Constructor with optional db table record id.

UserComment(data)

const HashArray& data

key-value pairs with property names as keys


Constructor with input from HashArray.

UserComment()

Create an empty UserComment

void clear()

Reset/clear the contents of this class

inline bool valid() const

Determine if this is valid data or not

Return value: true if valid; flase if not vali

inline DbRecNum getId() const

Get the value of the record id.

Return value: the value of id

inline DbRecNum getUserId() const

Get the value of the User id who posted the Comment.

Return value: the value of UserId

inline string getTitle() const

Get the value of the one-line description of the comment.

Return value: the value of Title

inline string getCommentType() const

Get the value of the type of comment, e.g. f=feature, b=bug, c=comment.

Return value: the value of CommentType

inline bool isBug() const

Check if this UserComment is a bug

Return value: true if it is a bug, false otherwise

inline bool isFeature() const

Check if this UserComment is a feature

Return value: true if it is a feature, false otherwise

inline bool isComment() const

Check if this UserComment is a comment

Return value: true if it is a comment, false otherwise

inline string getComment() const

Get the value of the text of the comment.

Return value: the value of Comment

inline time_t getPostTime() const

Get the value of timestamp of when the user submitted the comment.

Return value: the value of PostTime

inline time_t getReplyTime() const

Get the value of timestamp of when someone replied to the user.

Return value: the value of ReplyTime

inline DbRecNum getReplyUserId() const

Get the value of the User id of the person who replied.

Return value: the value of ReplyUserId

inline time_t getResolveTime() const

Get the value of timestamp of when the issue was resolved.

Return value: the value of ResolveTime

inline DbRecNum getResolveUserId() const

Get the value of the User id of the person who resolved the issue.

Return value: the value of ResolveUserId

inline int getSeverity() const

Get the value of the severity of the bug.

Return value: the value of Severity

inline int getPriority() const

Get the value of the priority of the bug/feature/sugestion.

Return value: the value of Priority

inline UserComment& setUserId(newUserId)

DbRecNum newUserId

the new value for UserId


Set the value of the User id who posted the Comment.

Return value: the updated instance of UserComment

inline UserComment& setTitle(newTitle)

const string& newTitle

the new value for Title


Set the value of the one-line description of the comment.

Return value: the updated instance of UserComment

inline UserComment& setTypeBug()

Set the value of the type of comment to bug

Return value: the updated instance of UserComment

inline UserComment& setTypeFeature()

Set the value of the type of comment to feature

Return value: the updated instance of UserComment

inline UserComment& setTypeComment()

Set the value of the type of comment to comment

Return value: the updated instance of UserComment

inline UserComment& setComment(newComment)

const string& newComment

the new value for Comment


Set the value of the text of the comment.

Return value: the updated instance of UserComment

inline UserComment& setPostTime(newPostTime)

time_t newPostTime

the new value for PostTime


Set the value of timestamp of when the user submitted the comment.

Return value: the updated instance of UserComment

inline UserComment& setReplyTime(newReplyTime)

time_t newReplyTime

the new value for ReplyTime


Set the value of timestamp of when someone replied to the user.

Return value: the updated instance of UserComment

inline UserComment& setReplyUserId(newReplyUserId)

DbRecNum newReplyUserId

the new value for ReplyUserId


Set the value of the User id of the person who replied.

Return value: the updated instance of UserComment

inline UserComment& setResolveTime(newResolveTime)

time_t newResolveTime

the new value for ResolveTime


Set the value of timestamp of when the issue was resolved.

Return value: the updated instance of UserComment

inline UserComment& setResolveUserId(newResolveUserId)

DbRecNum newResolveUserId

the new value for ResolveUserId


Set the value of the User id of the person who resolved the issue.

Return value: the updated instance of UserComment

inline UserComment& setSeverity(newSeverity)

int newSeverity

the new value for Severity


Set the value of the severity of the bug.

Return value: the updated instance of UserComment

inline UserComment& setPriority(newPriority)

int newPriority

the new value for Priority


Set the value of the priority of the bug/feature/sugestion.

Return value: the updated instance of UserComment

void set(data)

const HashArray& data


Given a set of UserComment properties in key-value pairs, initialize this instance with them.

This is complementary to toHashArray().

HashArray toHashArray(forDB) const

bool forDB

false to include Id; true to exclude Id, which is handy for sending to Datastore

Default value: false


Convert this instance's data into a HashArray.

This is the complement of set()

Return value: a HashArray of instance's properties

inline XMLData toXML(forDB) const

bool forDB

false to include Id; true to exclude Id, which is handy for sending to Datastore

Default value: false


Convert this instance's data to XML.

Return value: a XMLData of instance's properties

DbRecNum save()

Save this record to the Datastore.

If the data has not changed, it is not saved.

Return value: the Id upon success, 0 on failure

Protected Methods

bool load(id)

DbRecNum id

the id of the record to load


Load data from the Datastore with the provided Id.

Return value: true upon success; false upon faliure

Private Properties

DbRecNum id

the record id

DbRecNum UserId

the User id who posted the Comment

string Title

the one-line description of the comment

string CommentType

the type of comment, e.g. f=feature, b=bug, c=comment.

string Comment

the text of the comment

time_t PostTime

timestamp of when the user submitted the comment

time_t ReplyTime

timestamp of when someone replied to the user

DbRecNum ReplyUserId

the User id of the person who replied

time_t ResolveTime

timestamp of when the issue was resolved

DbRecNum ResolveUserId

the User id of the person who resolved the issue

int Severity

the severity of the bug

int Priority

the priority of the bug/feature/sugestion

bool changed

Flag: true if any data in this instance has changed

static Datastore db

Our connection to DB table data


Private Methods

static bool initdb()

Make sure we're connected to our table in the Datastore

Return value: true upon success, false upon failure

DbRecNum append()

Add a new record to the Datastore.

If the Id is set, it will be used; if 0, a new Id will be assigned.

Return value: the new record's record Id

inline void setCommentType(newCommentType)

const string& newCommentType


See Also

UserComment database table