本文整理汇总了PHP中thebuggenie\core\entities\Project::setWorkflowSchemeID方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::setWorkflowSchemeID方法的具体用法?PHP Project::setWorkflowSchemeID怎么用?PHP Project::setWorkflowSchemeID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\entities\Project
的用法示例。
在下文中一共展示了Project::setWorkflowSchemeID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runAddProject
/**
* Add a project (AJAX call)
*
* @param framework\Request $request The request object
*/
public function runAddProject(framework\Request $request)
{
$i18n = framework\Context::getI18n();
if (!framework\Context::getScope()->hasProjectsAvailable()) {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array("error" => $i18n->__("There are no more projects available in this instance")));
}
if ($this->access_level == framework\Settings::ACCESS_FULL) {
if (($p_name = $request['p_name']) && trim($p_name) != '') {
try {
$project = new entities\Project();
$project->setName($p_name);
$project->setWorkflowSchemeID($request['workflow_scheme_id']);
$project->setIssuetypeSchemeID($request['issuetype_scheme_id']);
$project->save();
return $this->renderJSON(array('message' => $i18n->__('The project has been added'), 'content' => $this->getComponentHTML('projectbox', array('project' => $project, 'access_level' => $this->access_level)), 'total_count' => entities\Project::getProjectsCount(), 'more_available' => framework\Context::getScope()->hasProjectsAvailable()));
} catch (\InvalidArgumentException $e) {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array("error" => $i18n->__('A project with the same key already exists')));
} catch (\Exception $e) {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array("error" => $i18n->__('An error occurred: ' . $e->getMessage())));
}
}
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array("error" => $i18n->__('Please specify a valid project name')));
}
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array("error" => $i18n->__("You don't have access to add projects")));
}