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


PHP PhabricatorProject::getSubprojectPHIDs方法代碼示例

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


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

示例1: updateProjectSubproject

 public static function updateProjectSubproject(PhabricatorProject $project)
 {
     $dao = new PhabricatorProjectSubproject();
     $conn = $dao->establishConnection('w');
     $sql = array();
     foreach ($project->getSubprojectPHIDs() as $subproject_phid) {
         $sql[] = qsprintf($conn, '(%s, %s)', $project->getPHID(), $subproject_phid);
     }
     queryfx($conn, 'DELETE FROM %T WHERE projectPHID = %s', $dao->getTableName(), $project->getPHID());
     if ($sql) {
         queryfx($conn, 'INSERT INTO %T (projectPHID, subprojectPHID) VALUES %Q', $dao->getTableName(), implode(', ', $sql));
     }
 }
開發者ID:nguyennamtien,項目名稱:phabricator,代碼行數:13,代碼來源:PhabricatorProjectSubproject.php

示例2: renderAboutPage

 private function renderAboutPage(PhabricatorProject $project, PhabricatorProjectProfile $profile)
 {
     $viewer = $this->getRequest()->getUser();
     $blurb = $profile->getBlurb();
     $blurb = phutil_escape_html($blurb);
     $blurb = str_replace("\n", '<br />', $blurb);
     $phids = array_merge(array($project->getAuthorPHID()), $project->getSubprojectPHIDs());
     $phids = array_unique($phids);
     $handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
     $timestamp = phabricator_datetime($project->getDateCreated(), $viewer);
     $about = '<div class="phabricator-profile-info-group">
     <h1 class="phabricator-profile-info-header">About</h1>
     <div class="phabricator-profile-info-pane">
       <table class="phabricator-profile-info-table">
         <tr>
           <th>Creator</th>
           <td>' . $handles[$project->getAuthorPHID()]->renderLink() . '</td>
         </tr>
         <tr>
           <th>Created</th>
           <td>' . $timestamp . '</td>
         </tr>
         <tr>
           <th>PHID</th>
           <td>' . phutil_escape_html($project->getPHID()) . '</td>
         </tr>
         <tr>
           <th>Blurb</th>
           <td>' . $blurb . '</td>
         </tr>
       </table>
     </div>
   </div>';
     if ($project->getSubprojectPHIDs()) {
         $table = $this->renderSubprojectTable($handles, $project->getSubprojectPHIDs());
         $subproject_list = $table->render();
     } else {
         $subproject_list = '<p><em>No subprojects.</em></p>';
     }
     $about .= '<div class="phabricator-profile-info-group">' . '<h1 class="phabricator-profile-info-header">Subprojects</h1>' . '<div class="phabricator-profile-info-pane">' . $subproject_list . '</div>' . '</div>';
     return $about;
 }
開發者ID:ramons03,項目名稱:phabricator,代碼行數:42,代碼來源:PhabricatorProjectProfileController.php


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