private function getOtherProjectsValues(PFUser $user, $submitted_facets) { $other_projects = array(); $all_projects_for_user = $this->project_manager->getAllMyAndPublicProjects($user); foreach ($all_projects_for_user as $project_id => $project) { if ($this->isProjectValid($project) && !$this->isProjectInSearchResults($project_id)) { $selected = isset($submitted_facets['group_id']) && in_array($project_id, $submitted_facets['group_id']); $other_projects[] = new ElasticSearch_SearchResultProjectsFacet($project, 0, $selected); } } usort($other_projects, array($this, 'sortProjects')); return $other_projects; }