mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-13 10:22:42 +01:00
4081579e79
Summary: Publish feed stories, including from Pholio. Actual stories are somewhat garbage but it's all display-time; I'm going to do a pass on feed in general. Test Plan: {F26832} Reviewers: btrahan, chad, vrana Reviewed By: btrahan CC: aran Maniphest Tasks: T2104 Differential Revision: https://secure.phabricator.com/D4140
51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @concrete-extensible
|
|
*/
|
|
class PhabricatorApplicationTransactionFeedStory
|
|
extends PhabricatorFeedStory {
|
|
|
|
public function getPrimaryObjectPHID() {
|
|
return $this->getValue('objectPHID');
|
|
}
|
|
|
|
public function getRequiredObjectPHIDs() {
|
|
return array(
|
|
$this->getPrimaryTransactionPHID(),
|
|
);
|
|
}
|
|
|
|
public function getRequiredHandlePHIDs() {
|
|
$phids = array();
|
|
$phids[] = array($this->getValue('objectPHID'));
|
|
$phids[] = $this->getPrimaryTransaction()->getRequiredHandlePHIDs();
|
|
return array_mergev($phids);
|
|
}
|
|
|
|
protected function getPrimaryTransactionPHID() {
|
|
return head($this->getValue('transactionPHIDs'));
|
|
}
|
|
|
|
protected function getPrimaryTransaction() {
|
|
return $this->getObject($this->getPrimaryTransactionPHID());
|
|
}
|
|
|
|
public function renderView() {
|
|
$view = new PhabricatorFeedStoryView();
|
|
$view->setViewed($this->getHasViewed());
|
|
|
|
$href = $this->getHandle($this->getPrimaryObjectPHID())->getURI();
|
|
$view->setHref($view);
|
|
|
|
$xaction_phids = $this->getValue('transactionPHIDs');
|
|
$xaction = $this->getObject(head($xaction_phids));
|
|
|
|
$xaction->setHandles($this->getHandles());
|
|
$view->setTitle($xaction->getTitleForFeed());
|
|
$view->setOneLineStory(true);
|
|
|
|
return $view;
|
|
}
|
|
|
|
}
|