本文整理汇总了PHP中PFUser::getAllProjects方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::getAllProjects方法的具体用法?PHP PFUser::getAllProjects怎么用?PHP PFUser::getAllProjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFUser
的用法示例。
在下文中一共展示了PFUser::getAllProjects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateSVNAccessForGivenMember
/**
* Update SVN access files into all projects that a given user belongs to
*
* It includes:
* + projects the user is member of
* + projects that have user groups that contains the user
*
* @param PFUser $user
*
* @return Boolean
*/
public function updateSVNAccessForGivenMember($user)
{
$projects = $user->getAllProjects();
if (isset($projects)) {
foreach ($projects as $groupId) {
$project = $this->getProjectManager()->getProject($groupId);
$this->updateProjectSVNAccessFile($project);
}
}
return true;
}
示例2: getUserProjectsAsOptions
public function getUserProjectsAsOptions(PFUser $user, ProjectManager $manager, $currentProjectId)
{
$purifier = Codendi_HTMLPurifier::instance();
$html = '';
$option = '<option value="%d" title="%s">%s</option>';
$usrProject = array_diff($user->getAllProjects(), array($currentProjectId));
foreach ($usrProject as $projectId) {
$project = $manager->getProject($projectId);
if ($user->isMember($projectId, 'A') && $project->usesService(GitPlugin::SERVICE_SHORTNAME)) {
$projectName = $project->getPublicName();
$projectUnixName = $purifier->purify($project->getUnixName());
$html .= sprintf($option, $projectId, $projectUnixName, $projectName);
}
}
return $html;
}