本文整理汇总了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));
}
}
示例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;
}