Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ability to mark comments as system-generated

  • Loading branch information...
commit 08b85f9eac0f6678587010dc1da62912c87dd706 1 parent d3947ef
@bjyoungblood bjyoungblood authored
View
38 application/modules/default/models/Comment.php
@@ -51,6 +51,13 @@ class Default_Model_Comment extends Issues_Model_Abstract implements Zend_Acl_Re
protected $_deleted;
/**
+ * _system
+ *
+ * @var boolean
+ */
+ protected $_system;
+
+ /**
* Get commentId.
*
* @return commentId
@@ -235,4 +242,35 @@ public function setDeleted($deleted)
$this->_deleted = $deleted ? true : false;
return $this;
}
+
+ /**
+ * Get system.
+ *
+ * @return system
+ */
+ public function getSystem()
+ {
+ return $this->_system;
+ }
+
+ /**
+ * isSystem
+ *
+ * @return boolean
+ */
+ public function isSystem()
+ {
+ return $this->getSystem();
+ }
+
+ /**
+ * Set system.
+ *
+ * @param $system the value to be set
+ */
+ public function setSystem($system)
+ {
+ $this->_system = $system ? true : false;
+ return $this;
+ }
}
View
3  application/modules/default/models/mappers/Comment.php
@@ -54,7 +54,8 @@ protected function _insert(Default_Model_Comment $comment)
'created_by' => $comment->getCreatedBy()->getUserId(),
'issue' => $comment->getIssue()->getIssueId(),
'text' => $comment->getText(),
- 'private' => $comment->isPrivate() ? 1 : 0
+ 'private' => $comment->isPrivate() ? 1 : 0,
+ 'system' => $comment->isSystem() ? 1 : 0
);
$db = $this->getWriteAdapter();
View
1  docs/schema.sql
@@ -94,6 +94,7 @@ CREATE TABLE `comment` (
`text` text NOT NULL,
`private` BOOLEAN NOT NULL DEFAULT '0',
`deleted` BOOLEAN NOT NULL DEFAULT '0',
+ `system` BOOLEAN NOT NULL DEFAULT '0' COMMENT 'whether the comment is system-generated',
PRIMARY KEY (`comment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Please sign in to comment.
Something went wrong with that request. Please try again.