1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-22 18:28:47 +02:00
phorge-phorge/src/applications/tokens/feed/PhabricatorTokenGivenFeedStory.php

41 lines
992 B
PHP
Raw Normal View History

<?php
final class PhabricatorTokenGivenFeedStory
extends PhabricatorFeedStory {
public function getPrimaryObjectPHID() {
return $this->getValue('objectPHID');
}
public function getRequiredHandlePHIDs() {
$phids = array();
$phids[] = $this->getValue('objectPHID');
$phids[] = $this->getValue('authorPHID');
return $phids;
}
public function renderView() {
$view = new PhabricatorFeedStoryView();
$view->setViewed($this->getHasViewed());
$href = $this->getHandle($this->getPrimaryObjectPHID())->getURI();
$view->setHref($view);
$title = pht(
'%s awarded %s a token.',
$this->linkTo($this->getValue('authorPHID')),
$this->linkTo($this->getValue('objectPHID')));
$view->setTitle($title);
$view->setOneLineStory(true);
return $view;
}
public function renderText() {
// TODO: This is grotesque; the feed notification handler relies on it.
return strip_tags($this->renderView()->render());
}
}