本文整理汇总了PHP中PhabricatorApplicationTransactionEditor::mergeEdgeData方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationTransactionEditor::mergeEdgeData方法的具体用法?PHP PhabricatorApplicationTransactionEditor::mergeEdgeData怎么用?PHP PhabricatorApplicationTransactionEditor::mergeEdgeData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplicationTransactionEditor
的用法示例。
在下文中一共展示了PhabricatorApplicationTransactionEditor::mergeEdgeData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mergeEdgeData
protected function mergeEdgeData($type, array $u, array $v)
{
$result = parent::mergeEdgeData($type, $u, $v);
switch ($type) {
case DifferentialRevisionHasReviewerEdgeType::EDGECONST:
// When the same reviewer has their status updated by multiple
// transactions, we want the strongest status to win. An example of
// this is when a user adds a comment and also accepts a revision which
// they are a reviewer on. The comment creates a "commented" status,
// while the accept creates an "accepted" status. Since accept is
// stronger, it should win and persist.
$u_status = idx($u, 'status');
$v_status = idx($v, 'status');
$u_str = DifferentialReviewerStatus::getStatusStrength($u_status);
$v_str = DifferentialReviewerStatus::getStatusStrength($v_status);
if ($u_str > $v_str) {
$result['status'] = $u_status;
} else {
$result['status'] = $v_status;
}
break;
}
return $result;
}