本文整理汇总了PHP中PhabricatorApplicationTransactionEditor::adjustObjectForPolicyChecks方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationTransactionEditor::adjustObjectForPolicyChecks方法的具体用法?PHP PhabricatorApplicationTransactionEditor::adjustObjectForPolicyChecks怎么用?PHP PhabricatorApplicationTransactionEditor::adjustObjectForPolicyChecks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplicationTransactionEditor
的用法示例。
在下文中一共展示了PhabricatorApplicationTransactionEditor::adjustObjectForPolicyChecks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adjustObjectForPolicyChecks
protected function adjustObjectForPolicyChecks(PhabricatorLiskDAO $object, array $xactions)
{
$copy = parent::adjustObjectForPolicyChecks($object, $xactions);
foreach ($xactions as $xaction) {
switch ($xaction->getTransactionType()) {
case PhabricatorCalendarEventHostTransaction::TRANSACTIONTYPE:
$copy->setHostPHID($xaction->getNewValue());
break;
case PhabricatorCalendarEventInviteTransaction::TRANSACTIONTYPE:
PhabricatorPolicyRule::passTransactionHintToRule($copy, new PhabricatorCalendarEventInviteesPolicyRule(), array_fuse($xaction->getNewValue()));
break;
}
}
return $copy;
}
示例2: adjustObjectForPolicyChecks
protected function adjustObjectForPolicyChecks(PhabricatorLiskDAO $object, array $xactions)
{
$copy = parent::adjustObjectForPolicyChecks($object, $xactions);
foreach ($xactions as $xaction) {
switch ($xaction->getTransactionType()) {
case ManiphestTransaction::TYPE_OWNER:
$copy->setOwnerPHID($xaction->getNewValue());
break;
default:
continue;
}
}
return $copy;
}
示例3: adjustObjectForPolicyChecks
protected function adjustObjectForPolicyChecks(PhabricatorLiskDAO $object, array $xactions)
{
$copy = parent::adjustObjectForPolicyChecks($object, $xactions);
$type_edge = PhabricatorTransactions::TYPE_EDGE;
$edgetype_member = PhabricatorProjectProjectHasMemberEdgeType::EDGECONST;
$member_xaction = null;
foreach ($xactions as $xaction) {
if ($xaction->getTransactionType() !== $type_edge) {
continue;
}
$edgetype = $xaction->getMetadataValue('edge:type');
if ($edgetype !== $edgetype_member) {
continue;
}
$member_xaction = $xaction;
}
if ($member_xaction) {
$object_phid = $object->getPHID();
if ($object_phid) {
$project = id(new PhabricatorProjectQuery())->setViewer($this->getActor())->withPHIDs(array($object_phid))->needMembers(true)->executeOne();
$members = $project->getMemberPHIDs();
} else {
$members = array();
}
$clone_xaction = clone $member_xaction;
$hint = $this->getPHIDTransactionNewValue($clone_xaction, $members);
$rule = new PhabricatorProjectMembersPolicyRule();
$hint = array_fuse($hint);
PhabricatorPolicyRule::passTransactionHintToRule($copy, $rule, $hint);
}
return $copy;
}