当前位置: 首页>>代码示例>>PHP>>正文


PHP PhabricatorApplicationTransactionEditor::adjustObjectForPolicyChecks方法代码示例

本文整理汇总了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;
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:15,代码来源:PhabricatorCalendarEventEditor.php

示例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;
 }
开发者ID:miaokuan,项目名称:phabricator,代码行数:14,代码来源:ManiphestTransactionEditor.php

示例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;
 }
开发者ID:jvlstudio,项目名称:phabricator,代码行数:32,代码来源:PhabricatorProjectTransactionEditor.php


注:本文中的PhabricatorApplicationTransactionEditor::adjustObjectForPolicyChecks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。