本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}