当前位置: 首页>>代码示例>>PHP>>正文


PHP PhabricatorApplicationTransaction::getBodyForFeed方法代码示例

本文整理汇总了PHP中PhabricatorApplicationTransaction::getBodyForFeed方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationTransaction::getBodyForFeed方法的具体用法?PHP PhabricatorApplicationTransaction::getBodyForFeed怎么用?PHP PhabricatorApplicationTransaction::getBodyForFeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorApplicationTransaction的用法示例。


在下文中一共展示了PhabricatorApplicationTransaction::getBodyForFeed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getBodyForFeed

 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     $new = $this->getNewValue();
     $body = null;
     switch ($this->getTransactionType()) {
         case self::TYPE_CONTENT:
             return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($new));
             break;
     }
     return parent::getBodyForFeed($story);
 }
开发者ID:denghp,项目名称:phabricator,代码行数:11,代码来源:PonderAnswerTransaction.php

示例2: getBodyForFeed

 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     $text = null;
     switch ($this->getTransactionType()) {
         case PholioTransactionType::TYPE_NAME:
             if ($this->getOldValue() === null) {
                 $mock = $story->getPrimaryObject();
                 $text = $mock->getDescription();
             }
             break;
         case PholioTransactionType::TYPE_INLINE:
             $text = $this->getComment()->getContent();
             break;
     }
     if ($text) {
         return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($text));
     }
     return parent::getBodyForFeed($story);
 }
开发者ID:denghp,项目名称:phabricator,代码行数:19,代码来源:PholioTransaction.php

示例3: getBodyForFeed

 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     $text = null;
     switch ($this->getTransactionType()) {
         case self::TYPE_TITLE:
             if ($this->getOldValue() === null) {
                 $post = $story->getPrimaryObject();
                 $text = $post->getBody();
             }
             break;
         case self::TYPE_VISIBILITY:
             if ($this->getNewValue() == PhameConstants::VISIBILITY_PUBLISHED) {
                 $post = $story->getPrimaryObject();
                 $text = $post->getBody();
             }
             break;
         case self::TYPE_BODY:
             $text = $this->getNewValue();
             break;
     }
     if (strlen($text)) {
         return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($text));
     }
     return parent::getBodyForFeed($story);
 }
开发者ID:hamilyjing,项目名称:phabricator,代码行数:25,代码来源:PhamePostTransaction.php

示例4: getBodyForFeed

 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     $new = $this->getNewValue();
     $old = $this->getOldValue();
     $body = null;
     switch ($this->getTransactionType()) {
         case self::TYPE_TITLE:
             if ($old === null) {
                 $question = $story->getObject($this->getObjectPHID());
                 return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($question->getContent()));
             }
             break;
         case self::TYPE_ANSWERS:
             $answer = $this->getNewAnswerObject($story);
             if ($answer) {
                 return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($answer->getContent()));
             }
             break;
     }
     return parent::getBodyForFeed($story);
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:21,代码来源:PonderQuestionTransaction.php

示例5: getBodyForFeed

 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     switch ($this->getTransactionType()) {
         case self::TYPE_COMMIT:
             $data = $this->getNewValue();
             return $story->renderSummary($data['summary']);
     }
     return parent::getBodyForFeed($story);
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:9,代码来源:PhabricatorAuditTransaction.php


注:本文中的PhabricatorApplicationTransaction::getBodyForFeed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。