You are here

protected function ApiSync::extractCategories in FormAssembly 8

Helper method for extracting forms nested within Categories.

Parameters

array $category: A Category array - may contain additional Category arrays.

1 call to ApiSync::extractCategories()
ApiSync::processResponse in src/ApiSync.php
Helper method to process responses property into forms array.

File

src/ApiSync.php, line 323

Class

ApiSync
Service class for FormAssembly API: Handles form sync.

Namespace

Drupal\formassembly

Code

protected function extractCategories(array $category) {
  foreach ($category as $formset) {
    if (!empty($formset['Category'])) {
      $this
        ->extractCategories($formset['Category']);
    }
    if (!empty($formset['Forms'])) {
      $this->forms = array_merge($this->forms, $formset['Forms']);
    }
  }
}