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