本文整理匯總了PHP中project::getTemplate方法的典型用法代碼示例。如果您正苦於以下問題:PHP project::getTemplate方法的具體用法?PHP project::getTemplate怎麽用?PHP project::getTemplate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類project
的用法示例。
在下文中一共展示了project::getTemplate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setReadWritePermissionsFromTemplate
private function setReadWritePermissionsFromTemplate(array $ugroup_mapping)
{
$template = ProjectManager::instance()->getProject($this->project->getTemplate());
$template_read_accesses = $this->mediawiki_manager->getReadAccessControl($template);
$template_write_accesses = $this->mediawiki_manager->getWriteAccessControl($template);
$this->mediawiki_manager->saveReadAccessControl($this->project, $this->getUgroupsForProjectFromMapping($template_read_accesses, $ugroup_mapping));
$this->mediawiki_manager->saveWriteAccessControl($this->project, $this->getUgroupsForProjectFromMapping($template_write_accesses, $ugroup_mapping));
}
示例2: seedUGroupMappingFromTemplate
private function seedUGroupMappingFromTemplate(array $ugroup_mapping)
{
$template = ProjectManager::instance()->getProject($this->project->getTemplate());
$mapper = new MediawikiUserGroupsMapper(new MediawikiDao(), new User_ForgeUserGroupPermissionsDao());
$template_mapping = $mapper->getCurrentUserGroupMapping($template);
$new_mapping = array();
foreach ($template_mapping as $mw_group => $tuleap_groups) {
foreach ($tuleap_groups as $grp) {
if ($grp < ProjectUGroup::DYNAMIC_UPPER_BOUNDARY) {
$new_mapping[$mw_group][] = $grp;
} elseif (isset($ugroup_mapping[$grp])) {
$new_mapping[$mw_group][] = $ugroup_mapping[$grp];
}
}
}
db_query($this->seedProjectUGroupMappings($this->project->getID(), $new_mapping));
}