本文整理匯總了PHP中ManiphestTaskStatus::isClaimStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP ManiphestTaskStatus::isClaimStatus方法的具體用法?PHP ManiphestTaskStatus::isClaimStatus怎麽用?PHP ManiphestTaskStatus::isClaimStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ManiphestTaskStatus
的用法示例。
在下文中一共展示了ManiphestTaskStatus::isClaimStatus方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: expandTransactions
protected function expandTransactions(PhabricatorLiskDAO $object, array $xactions)
{
$actor = $this->getActor();
$actor_phid = $actor->getPHID();
$results = parent::expandTransactions($object, $xactions);
$is_unassigned = $object->getOwnerPHID() === null;
$any_assign = false;
foreach ($xactions as $xaction) {
if ($xaction->getTransactionType() == ManiphestTransaction::TYPE_OWNER) {
$any_assign = true;
break;
}
}
$is_open = !$object->isClosed();
$new_status = null;
foreach ($xactions as $xaction) {
switch ($xaction->getTransactionType()) {
case ManiphestTransaction::TYPE_STATUS:
$new_status = $xaction->getNewValue();
break;
}
}
if ($new_status === null) {
$is_closing = false;
} else {
$is_closing = ManiphestTaskStatus::isClosedStatus($new_status);
}
// If the task is not assigned, not being assigned, currently open, and
// being closed, try to assign the actor as the owner.
if ($is_unassigned && !$any_assign && $is_open && $is_closing) {
$is_claim = ManiphestTaskStatus::isClaimStatus($new_status);
// Don't assign the actor if they aren't a real user.
// Don't claim the task if the status is configured to not claim.
if ($actor_phid && $is_claim) {
$results[] = id(new ManiphestTransaction())->setTransactionType(ManiphestTransaction::TYPE_OWNER)->setNewValue($actor_phid);
}
}
// Automatically subscribe the author when they create a task.
if ($this->getIsNewObject()) {
if ($actor_phid) {
$results[] = id(new ManiphestTransaction())->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS)->setNewValue(array('+' => array($actor_phid => $actor_phid)));
}
}
return $results;
}