You are here

public function DrupalGatherContentClient::getActiveProjects in GatherContent 8.5

Same name and namespace in other branches
  1. 8.4 src/DrupalGatherContentClient.php \Drupal\gathercontent\DrupalGatherContentClient::getActiveProjects()

Retrieve all the active projects.

File

src/DrupalGatherContentClient.php, line 63

Class

DrupalGatherContentClient
Extends the GatherContentClient class with Drupal specific functionality.

Namespace

Drupal\gathercontent

Code

public function getActiveProjects($accountId) {
  $projects = $this
    ->projectsGet($accountId);
  foreach ($projects['data'] as $id => $project) {
    if (!$project->active) {
      unset($projects['data'][$id]);
    }
  }
  $projects['data'] = $this
    ->reKeyArray($projects['data'], 'id');
  return $projects;
}