當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConduitAPIRequest::getAuditStatus方法代碼示例

本文整理匯總了PHP中ConduitAPIRequest::getAuditStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConduitAPIRequest::getAuditStatus方法的具體用法?PHP ConduitAPIRequest::getAuditStatus怎麽用?PHP ConduitAPIRequest::getAuditStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ConduitAPIRequest的用法示例。


在下文中一共展示了ConduitAPIRequest::getAuditStatus方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 protected function execute(ConduitAPIRequest $request)
 {
     $query = id(new DiffusionCommitQuery())->setViewer($request->getUser())->needAuditRequests(true);
     $auditor_phids = $request->getValue('auditorPHIDs', array());
     if ($auditor_phids) {
         $query->withAuditorPHIDs($auditor_phids);
     }
     $commit_phids = $request->getValue('commitPHIDs', array());
     if ($commit_phids) {
         $query->withPHIDs($commit_phids);
     }
     $status = $request->getValue('status', DiffusionCommitQuery::AUDIT_STATUS_ANY);
     $query->withAuditStatus($status);
     // NOTE: These affect the number of commits identified, which is sort of
     // reasonable but means the method may return an arbitrary number of
     // actual audit requests.
     $query->setOffset($request->getValue('offset', 0));
     $query->setLimit($request->getValue('limit', 100));
     $commits = $query->execute();
     $auditor_map = array_fuse($auditor_phids);
     $results = array();
     foreach ($commits as $commit) {
         $requests = $commit->getAudits();
         foreach ($requests as $request) {
             // If this audit isn't triggered for one of the requested PHIDs,
             // skip it.
             if ($auditor_map && empty($auditor_map[$request->getAuditorPHID()])) {
                 continue;
             }
             $results[] = array('id' => $request->getID(), 'commitPHID' => $request->getCommitPHID(), 'auditorPHID' => $request->getAuditorPHID(), 'reasons' => $request->getAuditReasons(), 'status' => $request->getAuditStatus());
         }
     }
     return $results;
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:34,代碼來源:AuditQueryConduitAPIMethod.php

示例2: execute

 protected function execute(ConduitAPIRequest $request)
 {
     $query = new PhabricatorAuditQuery();
     $auditor_phids = $request->getValue('auditorPHIDs', array());
     if ($auditor_phids) {
         $query->withAuditorPHIDs($auditor_phids);
     }
     $commit_phids = $request->getValue('commitPHIDs', array());
     if ($commit_phids) {
         $query->withCommitPHIDs($commit_phids);
     }
     $status = $request->getValue('status', PhabricatorAuditQuery::STATUS_ANY);
     $query->withStatus($status);
     $query->setOffset($request->getValue('offset', 0));
     $query->setLimit($request->getValue('limit', 100));
     $requests = $query->execute();
     $results = array();
     foreach ($requests as $request) {
         $results[] = array('id' => $request->getID(), 'commitPHID' => $request->getCommitPHID(), 'auditorPHID' => $request->getAuditorPHID(), 'reasons' => $request->getAuditReasons(), 'status' => $request->getAuditStatus());
     }
     return $results;
 }
開發者ID:nexeck,項目名稱:phabricator,代碼行數:22,代碼來源:ConduitAPI_audit_query_Method.php


注:本文中的ConduitAPIRequest::getAuditStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。