本文整理匯總了PHP中ManiphestTask::isHigherPriorityThan方法的典型用法代碼示例。如果您正苦於以下問題:PHP ManiphestTask::isHigherPriorityThan方法的具體用法?PHP ManiphestTask::isHigherPriorityThan怎麽用?PHP ManiphestTask::isHigherPriorityThan使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ManiphestTask
的用法示例。
在下文中一共展示了ManiphestTask::isHigherPriorityThan方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getPriorityTransactions
private function getPriorityTransactions(ManiphestTask $task, $after_phid, $before_phid)
{
list($after_task, $before_task) = $this->loadPriorityTasks($after_phid, $before_phid);
$must_move = false;
if ($after_task && !$task->isLowerPriorityThan($after_task)) {
$must_move = true;
}
if ($before_task && !$task->isHigherPriorityThan($before_task)) {
$must_move = true;
}
// The move doesn't require a priority change to be valid, so don't
// change the priority since we are not being forced to.
if (!$must_move) {
return array();
}
$try = array(array($after_task, true), array($before_task, false));
$pri = null;
$sub = null;
foreach ($try as $spec) {
list($task, $is_after) = $spec;
if (!$task) {
continue;
}
list($pri, $sub) = ManiphestTransactionEditor::getAdjacentSubpriority($task, $is_after);
}
$xactions = array();
if ($pri !== null) {
$xactions[] = id(new ManiphestTransaction())->setTransactionType(ManiphestTransaction::TYPE_PRIORITY)->setNewValue($pri);
$xactions[] = id(new ManiphestTransaction())->setTransactionType(ManiphestTransaction::TYPE_SUBPRIORITY)->setNewValue($sub);
}
return $xactions;
}