本文整理汇总了PHP中ProjectManager::activate方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectManager::activate方法的具体用法?PHP ProjectManager::activate怎么用?PHP ProjectManager::activate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectManager
的用法示例。
在下文中一共展示了ProjectManager::activate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: autoActivateProject
private function autoActivateProject($group)
{
$auto_approval = ForgeConfig::get('sys_project_approval', 1) ? PROJECT_APPROVAL_BY_ADMIN : PROJECT_APPROVAL_AUTO;
if ($this->force_activation || $auto_approval == PROJECT_APPROVAL_AUTO) {
$this->projectManager->activate($group);
}
}
示例2: createProject
/**
* Instantiates a project with user, groups, admins ...
*
* @param string $project_short_name
* @param string $project_long_name
* @param string $is_public
* @param array $project_members
* @param array $project_admins
*/
protected function createProject($project_short_name, $project_long_name, $is_public, array $project_members, array $project_admins, array $services)
{
$user = $this->user_manager->getUserByUserName(self::ADMIN_USER_NAME);
$this->user_manager->setCurrentUser($user);
$project = $this->project_creator->create($project_short_name, $project_long_name, array('project' => array('form_short_description' => '', 'is_test' => false, 'is_public' => $is_public, 'services' => $services, 'built_from_template' => 100)));
$this->project_manager->activate($project);
foreach ($project_members as $project_member) {
$this->addMembersToProject($project, $project_member);
}
foreach ($project_admins as $project_admin) {
$this->addAdminToProject($project, $project_admin);
}
return $project;
}
示例3: formatDataAndCreateProject
/**
* Create the data array needed by create_project and create the project
*
* @param String $shortName
* @param String $publicName
* @param String $privacy
* @param Project $template
*
* @return Integer
*/
private function formatDataAndCreateProject($shortName, $publicName, $privacy, Project $template)
{
$data = array('project' => array('form_license' => 'xrx', 'form_license_other' => '', 'form_short_description' => '', 'is_test' => false, 'is_public' => false, 'services' => array(), 'built_from_template' => $template->getID()));
if ($privacy === Project::ACCESS_PUBLIC) {
$data['project']['is_public'] = true;
}
foreach ($template->getServices() as $key => $service) {
$is_used = $service->isActive() && $service->isUsed();
$data['project']['services'][$service->getId()]['is_used'] = $is_used;
}
$project = $this->projectCreator->create($shortName, $publicName, $data);
$this->projectManager->activate($project);
return $project->getID();
}