Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

ability to mark comments as system-generated

  • Loading branch information...
commit 08b85f9eac0f6678587010dc1da62912c87dd706 1 parent d3947ef
Ben Youngblood bjyoungblood authored
38 application/modules/default/models/Comment.php
@@ -51,6 +51,13 @@ class Default_Model_Comment extends Issues_Model_Abstract implements Zend_Acl_Re
51 51 protected $_deleted;
52 52
53 53 /**
  54 + * _system
  55 + *
  56 + * @var boolean
  57 + */
  58 + protected $_system;
  59 +
  60 + /**
54 61 * Get commentId.
55 62 *
56 63 * @return commentId
@@ -235,4 +242,35 @@ public function setDeleted($deleted)
235 242 $this->_deleted = $deleted ? true : false;
236 243 return $this;
237 244 }
  245 +
  246 + /**
  247 + * Get system.
  248 + *
  249 + * @return system
  250 + */
  251 + public function getSystem()
  252 + {
  253 + return $this->_system;
  254 + }
  255 +
  256 + /**
  257 + * isSystem
  258 + *
  259 + * @return boolean
  260 + */
  261 + public function isSystem()
  262 + {
  263 + return $this->getSystem();
  264 + }
  265 +
  266 + /**
  267 + * Set system.
  268 + *
  269 + * @param $system the value to be set
  270 + */
  271 + public function setSystem($system)
  272 + {
  273 + $this->_system = $system ? true : false;
  274 + return $this;
  275 + }
238 276 }
3  application/modules/default/models/mappers/Comment.php
@@ -54,7 +54,8 @@ protected function _insert(Default_Model_Comment $comment)
54 54 'created_by' => $comment->getCreatedBy()->getUserId(),
55 55 'issue' => $comment->getIssue()->getIssueId(),
56 56 'text' => $comment->getText(),
57   - 'private' => $comment->isPrivate() ? 1 : 0
  57 + 'private' => $comment->isPrivate() ? 1 : 0,
  58 + 'system' => $comment->isSystem() ? 1 : 0
58 59 );
59 60
60 61 $db = $this->getWriteAdapter();
1  docs/schema.sql
@@ -94,6 +94,7 @@ CREATE TABLE `comment` (
94 94 `text` text NOT NULL,
95 95 `private` BOOLEAN NOT NULL DEFAULT '0',
96 96 `deleted` BOOLEAN NOT NULL DEFAULT '0',
  97 + `system` BOOLEAN NOT NULL DEFAULT '0' COMMENT 'whether the comment is system-generated',
97 98 PRIMARY KEY (`comment_id`)
98 99 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
99 100

0 comments on commit 08b85f9

Please sign in to comment.
Something went wrong with that request. Please try again.