本文整理匯總了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;
}