本文整理汇总了PHP中Project::isError方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::isError方法的具体用法?PHP Project::isError怎么用?PHP Project::isError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project::isError方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct(Project $project, $url, $feedback, MailBuilder $mail_builder)
{
parent::__construct();
$this->project = $project;
$this->_url = $url;
$this->_listeners = array();
$this->_feedback = $feedback;
$this->_item_factory = $this->_getItemFactory();
$this->notifications = array();
$this->mail_builder = $mail_builder;
if ($project && !$project->isError()) {
$this->_group_name = $project->getPublicName();
}
}
示例2: checkIfProjectIsValid
private function checkIfProjectIsValid(Project $project)
{
if ($project->isError()) {
$GLOBALS['Response']->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('plugin_git', 'view_admin_template_invalid_project'));
return;
}
return true;
}
示例3: isSearchEntryAvailable
private function isSearchEntryAvailable(Project $project = null)
{
if ($project && !$project->isError()) {
return $project->usesService(self::SERVICE_SHORTNAME);
}
return false;
}
示例4: isSearchEntryAvailable
private function isSearchEntryAvailable(Project $project = null)
{
if ($project && !$project->isError()) {
return $project->usesService('plugin_phpwiki');
}
return false;
}
示例5: userCanAccessProject
/**
* Ensure given user can access given project
*
* @param PFUser $user
* @param Project $project
* @return boolean
* @throws Project_AccessProjectNotFoundException
* @throws Project_AccessDeletedException
* @throws Project_AccessRestrictedException
* @throws Project_AccessPrivateException
*/
public function userCanAccessProject(PFUser $user, Project $project)
{
if ($project->isError()) {
throw new Project_AccessProjectNotFoundException();
} elseif ($user->isSuperUser()) {
return true;
} elseif (!$project->isActive()) {
throw new Project_AccessDeletedException($project);
} elseif ($user->isMember($project->getID())) {
return true;
} elseif ($this->getPermissionsOverriderManager()->doesOverriderAllowUserToAccessProject($user, $project)) {
return true;
} elseif ($user->isRestricted()) {
if (!$project->allowsRestricted() || !$this->restrictedUserCanAccessUrl($user, $this->getUrl(), $_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME'])) {
throw new Project_AccessRestrictedException();
}
return true;
} elseif ($project->isPublic()) {
return true;
} elseif ($this->userHasBeenDelegatedAccess($user)) {
return true;
}
throw new Project_AccessPrivateException();
}
示例6: getTemplatesAvailableForParentProjects
/**
* Get All templates for projects higher in hierarchy. Does not include
* templates for project itself.
*
* @param Project $project
* @return Git_Driver_Gerrit_Template_Template[]
*/
public function getTemplatesAvailableForParentProjects(Project $project)
{
if ($project->isError()) {
return array();
}
$templates = array();
$project_manager = ProjectManager::instance();
$projects = $project_manager->getAllParentsProjects($project->getId());
foreach ($projects as $project) {
$templates = array_merge($templates, $this->getAllTemplatesOfProject($project));
}
return $templates;
}
示例7: userCanAccessProject
/**
* Ensure given user can access given project
*
* @param PFUser $user
* @param Project $project
* @return boolean
* @throws Project_AccessProjectNotFoundException
* @throws Project_AccessDeletedException
* @throws Project_AccessRestrictedException
* @throws Project_AccessPrivateException
*/
public function userCanAccessProject(PFUser $user, Project $project)
{
if ($project->isError()) {
throw new Project_AccessProjectNotFoundException();
} elseif ($user->isSuperUser()) {
return true;
} elseif (!$project->isActive()) {
throw new Project_AccessDeletedException($project);
} elseif ($user->isMember($project->getID())) {
return true;
} elseif ($user->isRestricted() && !$this->canRestrictedUserAccess($user, $project)) {
throw new Project_AccessRestrictedException();
} elseif ($project->isPublic()) {
return true;
} elseif ($this->userHasBeenDelegatedAccess($user)) {
return true;
}
throw new Project_AccessPrivateException();
}