Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15444345
D21479.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D21479.id.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1557,6 +1557,7 @@
'HeraldBuildableState' => 'applications/herald/state/HeraldBuildableState.php',
'HeraldCallWebhookAction' => 'applications/herald/action/HeraldCallWebhookAction.php',
'HeraldCommentAction' => 'applications/herald/action/HeraldCommentAction.php',
+ 'HeraldCommentContentField' => 'applications/herald/field/HeraldCommentContentField.php',
'HeraldCommitAdapter' => 'applications/diffusion/herald/HeraldCommitAdapter.php',
'HeraldCondition' => 'applications/herald/storage/HeraldCondition.php',
'HeraldConditionTranscript' => 'applications/herald/storage/transcript/HeraldConditionTranscript.php',
@@ -7770,6 +7771,7 @@
'HeraldBuildableState' => 'HeraldState',
'HeraldCallWebhookAction' => 'HeraldAction',
'HeraldCommentAction' => 'HeraldAction',
+ 'HeraldCommentContentField' => 'HeraldField',
'HeraldCommitAdapter' => array(
'HeraldAdapter',
'HarbormasterBuildableAdapterInterface',
diff --git a/src/applications/herald/field/HeraldCommentContentField.php b/src/applications/herald/field/HeraldCommentContentField.php
new file mode 100644
--- /dev/null
+++ b/src/applications/herald/field/HeraldCommentContentField.php
@@ -0,0 +1,43 @@
+<?php
+
+final class HeraldCommentContentField extends HeraldField {
+
+ const FIELDCONST = 'comment.content';
+
+ public function getHeraldFieldName() {
+ return pht('Comment content');
+ }
+
+ public function getFieldGroupKey() {
+ return HeraldTransactionsFieldGroup::FIELDGROUPKEY;
+ }
+
+ public function getHeraldFieldValue($object) {
+ $adapter = $this->getAdapter();
+
+ $xactions = $adapter->getAppliedTransactions();
+
+ $result = array();
+ foreach ($xactions as $xaction) {
+ if (!$xaction->hasComment()) {
+ continue;
+ }
+
+ $comment = $xaction->getComment();
+ $content = $comment->getContent();
+
+ $result[] = $content;
+ }
+
+ return $result;
+ }
+
+ public function supportsObject($object) {
+ return true;
+ }
+
+ protected function getHeraldFieldStandardType() {
+ return self::STANDARD_TEXT_LIST;
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 28, 9:09 AM (2 w, 5 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7708429
Default Alt Text
D21479.id.diff (2 KB)
Attached To
Mode
D21479: Add a "Comment content" field to Herald
Attached
Detach File
Event Timeline
Log In to Comment