本文整理汇总了PHP中PhabricatorProject::getHasSubprojects方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorProject::getHasSubprojects方法的具体用法?PHP PhabricatorProject::getHasSubprojects怎么用?PHP PhabricatorProject::getHasSubprojects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorProject
的用法示例。
在下文中一共展示了PhabricatorProject::getHasSubprojects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildSubprojectList
private function buildSubprojectList(PhabricatorProject $project)
{
if (!$project->getHasSubprojects()) {
return null;
}
$viewer = $this->getViewer();
$id = $project->getID();
$limit = 25;
$subprojects = id(new PhabricatorProjectQuery())->setViewer($viewer)->withParentProjectPHIDs(array($project->getPHID()))->needImages(true)->withStatuses(array(PhabricatorProjectStatus::STATUS_ACTIVE))->withIsMilestone(false)->setLimit($limit)->execute();
if (!$subprojects) {
return null;
}
$subproject_list = id(new PhabricatorProjectListView())->setUser($viewer)->setProjects($subprojects)->renderList();
$view_all = id(new PHUIButtonView())->setTag('a')->setIcon(id(new PHUIIconView())->setIcon('fa-list-ul'))->setText(pht('View All'))->setHref("/project/subprojects/{$id}/");
$header = id(new PHUIHeaderView())->setHeader(pht('Subprojects'))->addActionLink($view_all);
return id(new PHUIObjectBoxView())->setHeader($header)->setBackground(PHUIBoxView::GREY)->setObjectList($subproject_list);
}