本文整理汇总了PHP中PhabricatorApplicationTransactionEditor::getDiffUpdateTransaction方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationTransactionEditor::getDiffUpdateTransaction方法的具体用法?PHP PhabricatorApplicationTransactionEditor::getDiffUpdateTransaction怎么用?PHP PhabricatorApplicationTransactionEditor::getDiffUpdateTransaction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplicationTransactionEditor
的用法示例。
在下文中一共展示了PhabricatorApplicationTransactionEditor::getDiffUpdateTransaction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateTransactionMailBody
public function updateTransactionMailBody(PhabricatorMetaMTAMailBody $body, PhabricatorApplicationTransactionEditor $editor, array $xactions)
{
$status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED;
// Show the "BRANCH" section only if there's a new diff or the revision
// is "Accepted".
if (!$editor->getDiffUpdateTransaction($xactions) && $this->getObject()->getStatus() != $status_accepted) {
return;
}
$branch = $this->getBranchDescription($this->getObject()->getActiveDiff());
if ($branch === null) {
return;
}
$body->addTextSection(pht('BRANCH'), $branch);
}
示例2: updateTransactionMailBody
public function updateTransactionMailBody(PhabricatorMetaMTAMailBody $body, PhabricatorApplicationTransactionEditor $editor, array $xactions)
{
if ($editor->getIsNewObject()) {
return;
}
if ($editor->getIsCloseByCommit()) {
return;
}
$xaction = $editor->getDiffUpdateTransaction($xactions);
if (!$xaction) {
return;
}
$original = id(new DifferentialDiffQuery())->setViewer($this->getViewer())->withPHIDs(array($xaction->getOldValue()))->executeOne();
if (!$original) {
return;
}
$revision = $this->getObject();
$current = $revision->getActiveDiff();
$old_id = $original->getID();
$new_id = $current->getID();
$uri = '/' . $revision->getMonogram() . '?vs=' . $old_id . '&id=' . $new_id;
$uri = PhabricatorEnv::getProductionURI($uri);
$body->addTextSection(pht('CHANGES SINCE LAST UPDATE'), $uri);
}