You are here

function GLExchange::getProjects in GlobalLink Connect for Drupal 7.7

* Get all user projects * *

Return value

Array of PDProject to which the logged in user has access to

2 calls to GLExchange::getProjects()
GLExchange::getCancelledTargets in gl_ws/glc/GLExchange.php
* Get cancelled targets for all projects * *
GLExchange::getCompletedTargets in gl_ws/glc/GLExchange.php
* Get completed targets for all projects * *

File

gl_ws/glc/GLExchange.php, line 359

Class

GLExchange

Code

function getProjects() {
  $getUserProjectsRequest = new getUserProjects();
  $getUserProjectsRequest->isSubProjectIncluded = TRUE;
  $projects = $this->projectService
    ->getUserProjects($getUserProjectsRequest)->return;
  $i = 0;
  $proj_arr = array();
  if (is_array($projects)) {
    foreach ($projects as $project) {
      $pdproject = new PDProject($project);
      $proj_arr[$i++] = $pdproject;
    }
  }
  else {
    $fullProject = $this
      ->getProject($projects->projectInfo->shortCode);
    $proj_arr[0] = $fullProject;
  }
  return $proj_arr;
}