本文整理汇总了PHP中ProjectManager::getChildProjects方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectManager::getChildProjects方法的具体用法?PHP ProjectManager::getChildProjects怎么用?PHP ProjectManager::getChildProjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectManager
的用法示例。
在下文中一共展示了ProjectManager::getChildProjects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getServersForProjectAndItsChildren
private function getServersForProjectAndItsChildren(Project $project)
{
$remote_servers = $this->gerrit_server_factory->getServersForProject($project);
$children = $this->project_manager->getChildProjects($project->getID());
foreach ($children as $child) {
$child_remote_servers = $this->gerrit_server_factory->getServersForProject($child);
$remote_servers = array_unique(array_merge($remote_servers, $child_remote_servers));
}
return $remote_servers;
}
示例2: getServersForProject
/**
* @return Git_RemoteServer_GerritServer[]
*/
public function getServersForProject(Project $project)
{
$servers = array();
foreach ($this->dao->searchAllByProjectId($project->getID()) as $row) {
$servers[$row['id']] = $this->instantiateFromRow($row);
}
foreach ($this->project_manager->getChildProjects($project->getID()) as $child) {
// don't use array_merge, it will nuke the keys
$servers = $servers + $this->getServersForProject($child);
}
return $servers;
}