diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index c4f688ac23..4f6ae109bb 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1557,6 +1557,7 @@ phutil_register_library_map(array( '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 @@ phutil_register_library_map(array( '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 index 0000000000..d74a78fe45 --- /dev/null +++ b/src/applications/herald/field/HeraldCommentContentField.php @@ -0,0 +1,43 @@ +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; + } + +}