Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepositoryCommit.php
<?php | <?php | ||||
final class PhabricatorRepositoryCommit | final class PhabricatorRepositoryCommit | ||||
extends PhabricatorRepositoryDAO | extends PhabricatorRepositoryDAO | ||||
implements | implements | ||||
PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
PhabricatorFlaggableInterface, | PhabricatorFlaggableInterface, | ||||
PhabricatorProjectInterface, | PhabricatorProjectInterface, | ||||
PhabricatorTokenReceiverInterface, | PhabricatorTokenReceiverInterface, | ||||
PhabricatorSubscribableInterface, | PhabricatorSubscribableInterface, | ||||
PhabricatorMentionableInterface, | PhabricatorMentionableInterface, | ||||
HarbormasterBuildableInterface, | HarbormasterBuildableInterface, | ||||
HarbormasterCircleCIBuildableInterface, | HarbormasterCircleCIBuildableInterface, | ||||
HarbormasterBuildkiteBuildableInterface, | HarbormasterBuildkiteBuildableInterface, | ||||
PhabricatorCustomFieldInterface, | PhabricatorCustomFieldInterface, | ||||
PhabricatorApplicationTransactionInterface, | PhabricatorApplicationTransactionInterface, | ||||
PhabricatorTimelineInterface, | |||||
PhabricatorFulltextInterface, | PhabricatorFulltextInterface, | ||||
PhabricatorFerretInterface, | PhabricatorFerretInterface, | ||||
PhabricatorConduitResultInterface, | PhabricatorConduitResultInterface, | ||||
PhabricatorDraftInterface { | PhabricatorDraftInterface { | ||||
protected $repositoryID; | protected $repositoryID; | ||||
protected $phid; | protected $phid; | ||||
protected $authorIdentityPHID; | protected $authorIdentityPHID; | ||||
▲ Show 20 Lines • Show All 708 Lines • ▼ Show 20 Lines | /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | ||||
public function getApplicationTransactionObject() { | public function getApplicationTransactionObject() { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getApplicationTransactionTemplate() { | public function getApplicationTransactionTemplate() { | ||||
return new PhabricatorAuditTransaction(); | return new PhabricatorAuditTransaction(); | ||||
} | } | ||||
public function willRenderTimeline( | |||||
PhabricatorApplicationTransactionView $timeline, | |||||
AphrontRequest $request) { | |||||
$xactions = $timeline->getTransactions(); | |||||
$path_ids = array(); | |||||
foreach ($xactions as $xaction) { | |||||
if ($xaction->hasComment()) { | |||||
$path_id = $xaction->getComment()->getPathID(); | |||||
if ($path_id) { | |||||
$path_ids[] = $path_id; | |||||
} | |||||
} | |||||
} | |||||
$path_map = array(); | |||||
if ($path_ids) { | |||||
$path_map = id(new DiffusionPathQuery()) | |||||
->withPathIDs($path_ids) | |||||
->execute(); | |||||
$path_map = ipull($path_map, 'path', 'id'); | |||||
} | |||||
return $timeline->setPathMap($path_map); | |||||
} | |||||
/* -( PhabricatorFulltextInterface )--------------------------------------- */ | /* -( PhabricatorFulltextInterface )--------------------------------------- */ | ||||
public function newFulltextEngine() { | public function newFulltextEngine() { | ||||
return new DiffusionCommitFulltextEngine(); | return new DiffusionCommitFulltextEngine(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | public function getHasDraft(PhabricatorUser $viewer) { | ||||
return $this->assertAttachedKey($this->drafts, $viewer->getCacheFragment()); | return $this->assertAttachedKey($this->drafts, $viewer->getCacheFragment()); | ||||
} | } | ||||
public function attachHasDraft(PhabricatorUser $viewer, $has_draft) { | public function attachHasDraft(PhabricatorUser $viewer, $has_draft) { | ||||
$this->drafts[$viewer->getCacheFragment()] = $has_draft; | $this->drafts[$viewer->getCacheFragment()] = $has_draft; | ||||
return $this; | return $this; | ||||
} | } | ||||
/* -( PhabricatorTimelineInterface )--------------------------------------- */ | |||||
public function newTimelineEngine() { | |||||
return new DiffusionCommitTimelineEngine(); | |||||
} | |||||
} | } |