You are here

public function DrupalGatherContentClient::getTemplatesOptionArray in GatherContent 8.4

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

Returns a formatted array with the template ID's as a key.

Parameters

int $project_id: Project ID.

Return value

array Return array.

File

src/DrupalGatherContentClient.php, line 83

Class

DrupalGatherContentClient
Extends the GatherContentClient class with Drupal specific functionality.

Namespace

Drupal\gathercontent

Code

public function getTemplatesOptionArray($project_id) {
  $formatted = [];
  $templates = $this
    ->templatesGet($project_id);
  foreach ($templates as $id => $template) {
    $formatted[$id] = $template->name;
  }
  return $formatted;
}