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


PHP PhabricatorLiskDAO::getAuthorPHID方法代码示例

本文整理汇总了PHP中PhabricatorLiskDAO::getAuthorPHID方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorLiskDAO::getAuthorPHID方法的具体用法?PHP PhabricatorLiskDAO::getAuthorPHID怎么用?PHP PhabricatorLiskDAO::getAuthorPHID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorLiskDAO的用法示例。


在下文中一共展示了PhabricatorLiskDAO::getAuthorPHID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMailTo

 protected function getMailTo(PhabricatorLiskDAO $object)
 {
     $phids = array();
     $phids[] = $object->getAuthorPHID();
     $phids[] = $this->requireActor()->getPHID();
     $question = id(new PonderQuestionQuery())->setViewer($this->requireActor())->withIDs(array($object->getQuestionID()))->executeOne();
     $phids[] = $question->getAuthorPHID();
     return $phids;
 }
开发者ID:nilsdornblut,项目名称:phabricator,代码行数:9,代码来源:PonderAnswerEditor.php

示例2: getMailTo

 protected function getMailTo(PhabricatorLiskDAO $object)
 {
     return array($object->getAuthorPHID(), $this->requireActor()->getPHID());
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:4,代码来源:PhabricatorSlowvoteEditor.php

示例3: didApplyHeraldRules

 protected function didApplyHeraldRules(PhabricatorLiskDAO $object, HeraldAdapter $adapter, HeraldTranscript $transcript)
 {
     $xactions = array();
     // Build a transaction to adjust reviewers.
     $reviewers = array(DifferentialReviewerStatus::STATUS_ADDED => array_keys($adapter->getReviewersAddedByHerald()), DifferentialReviewerStatus::STATUS_BLOCKING => array_keys($adapter->getBlockingReviewersAddedByHerald()));
     $old_reviewers = $object->getReviewerStatus();
     $old_reviewers = mpull($old_reviewers, null, 'getReviewerPHID');
     $value = array();
     foreach ($reviewers as $status => $phids) {
         foreach ($phids as $phid) {
             if ($phid == $object->getAuthorPHID()) {
                 // Don't try to add the revision's author as a reviewer, since this
                 // isn't valid and doesn't make sense.
                 continue;
             }
             // If the target is already a reviewer, don't try to change anything
             // if their current status is at least as strong as the new status.
             // For example, don't downgrade an "Accepted" to a "Blocking Reviewer".
             $old_reviewer = idx($old_reviewers, $phid);
             if ($old_reviewer) {
                 $old_status = $old_reviewer->getStatus();
                 $old_strength = DifferentialReviewerStatus::getStatusStrength($old_status);
                 $new_strength = DifferentialReviewerStatus::getStatusStrength($status);
                 if ($new_strength <= $old_strength) {
                     continue;
                 }
             }
             $value['+'][$phid] = array('data' => array('status' => $status));
         }
     }
     if ($value) {
         $edge_reviewer = DifferentialRevisionHasReviewerEdgeType::EDGECONST;
         $xactions[] = id(new DifferentialTransaction())->setTransactionType(PhabricatorTransactions::TYPE_EDGE)->setMetadataValue('edge:type', $edge_reviewer)->setNewValue($value);
     }
     // Require legalpad document signatures.
     $legal_phids = $adapter->getRequiredSignatureDocumentPHIDs();
     if ($legal_phids) {
         // We only require signatures of documents which have not already
         // been signed. In general, this reduces the amount of churn that
         // signature rules cause.
         $signatures = id(new LegalpadDocumentSignatureQuery())->setViewer(PhabricatorUser::getOmnipotentUser())->withDocumentPHIDs($legal_phids)->withSignerPHIDs(array($object->getAuthorPHID()))->execute();
         $signed_phids = mpull($signatures, 'getDocumentPHID');
         $legal_phids = array_diff($legal_phids, $signed_phids);
         // If we still have something to trigger, add the edges.
         if ($legal_phids) {
             $edge_legal = LegalpadObjectNeedsSignatureEdgeType::EDGECONST;
             $xactions[] = id(new DifferentialTransaction())->setTransactionType(PhabricatorTransactions::TYPE_EDGE)->setMetadataValue('edge:type', $edge_legal)->setNewValue(array('+' => array_fuse($legal_phids)));
         }
     }
     // Apply build plans.
     HarbormasterBuildable::applyBuildPlans($adapter->getDiff()->getPHID(), $adapter->getPHID(), $adapter->getBuildPlans());
     return $xactions;
 }
开发者ID:kristain,项目名称:phabricator,代码行数:53,代码来源:DifferentialTransactionEditor.php

示例4: getMailTo

 protected function getMailTo(PhabricatorLiskDAO $object)
 {
     $phids = array();
     if ($object->getAuthorPHID()) {
         $phids[] = $object->getAuthorPHID();
     }
     $status_resigned = PhabricatorAuditStatusConstants::RESIGNED;
     foreach ($object->getAudits() as $audit) {
         if ($audit->getAuditStatus() != $status_resigned) {
             $phids[] = $audit->getAuditorPHID();
         }
     }
     return $phids;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:14,代码来源:PhabricatorAuditEditor.php

示例5: didApplyHeraldRules

 protected function didApplyHeraldRules(PhabricatorLiskDAO $object, HeraldAdapter $adapter, HeraldTranscript $transcript)
 {
     $repository = $object->getRepository();
     if (!$repository) {
         return array();
     }
     if (!$this->affectedPaths) {
         return array();
     }
     $packages = PhabricatorOwnersPackage::loadAffectedPackages($repository, $this->affectedPaths);
     if (!$packages) {
         return array();
     }
     // Remove packages that the revision author is an owner of. If you own
     // code, you don't need another owner to review it.
     $authority = id(new PhabricatorOwnersPackageQuery())->setViewer(PhabricatorUser::getOmnipotentUser())->withPHIDs(mpull($packages, 'getPHID'))->withAuthorityPHIDs(array($object->getAuthorPHID()))->execute();
     $authority = mpull($authority, null, 'getPHID');
     foreach ($packages as $key => $package) {
         $package_phid = $package->getPHID();
         if (isset($authority[$package_phid])) {
             unset($packages[$key]);
             continue;
         }
     }
     if (!$packages) {
         return array();
     }
     $auto_subscribe = array();
     $auto_review = array();
     $auto_block = array();
     foreach ($packages as $package) {
         switch ($package->getAutoReview()) {
             case PhabricatorOwnersPackage::AUTOREVIEW_SUBSCRIBE:
                 $auto_subscribe[] = $package;
                 break;
             case PhabricatorOwnersPackage::AUTOREVIEW_REVIEW:
                 $auto_review[] = $package;
                 break;
             case PhabricatorOwnersPackage::AUTOREVIEW_BLOCK:
                 $auto_block[] = $package;
                 break;
             case PhabricatorOwnersPackage::AUTOREVIEW_NONE:
             default:
                 break;
         }
     }
     $owners_phid = id(new PhabricatorOwnersApplication())->getPHID();
     $xactions = array();
     if ($auto_subscribe) {
         $xactions[] = $object->getApplicationTransactionTemplate()->setAuthorPHID($owners_phid)->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS)->setNewValue(array('+' => mpull($auto_subscribe, 'getPHID')));
     }
     $specs = array(array($auto_review, false), array($auto_block, true));
     foreach ($specs as $spec) {
         list($reviewers, $blocking) = $spec;
         if (!$reviewers) {
             continue;
         }
         $phids = mpull($reviewers, 'getPHID');
         $xaction = $this->newAutoReviewTransaction($object, $phids, $blocking);
         if ($xaction) {
             $xactions[] = $xaction;
         }
     }
     return $xactions;
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:65,代码来源:DifferentialTransactionEditor.php

示例6: getMailTo

 protected function getMailTo(PhabricatorLiskDAO $object)
 {
     $phids = array();
     $phids[] = $object->getAuthorPHID();
     foreach ($object->getReviewerStatus() as $reviewer) {
         $phids[] = $reviewer->getReviewerPHID();
     }
     return $phids;
 }
开发者ID:Escalation,项目名称:phabricator,代码行数:9,代码来源:DifferentialTransactionEditor.php

示例7: getMailTo

 protected function getMailTo(PhabricatorLiskDAO $object)
 {
     $phids = array();
     if ($object->getAuthorPHID()) {
         $phids[] = $object->getAuthorPHID();
     }
     $status_resigned = PhabricatorAuditStatusConstants::RESIGNED;
     foreach ($object->getAudits() as $audit) {
         if (!$audit->isInteresting()) {
             // Don't send mail to uninteresting auditors, like packages which
             // own this code but which audits have not triggered for.
             continue;
         }
         if ($audit->getAuditStatus() != $status_resigned) {
             $phids[] = $audit->getAuditorPHID();
         }
     }
     $phids[] = $this->getActingAsPHID();
     return $phids;
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:20,代码来源:PhabricatorAuditEditor.php


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