You are here

protected function ListPaymentStatuses::buildHierarchyLevel in Payment 8.2

Helper function for self::hierarchy().

Parameters

string[] $parent_plugin_ids: An array with IDs of plugins that are part of the same hierarchy level.

string[] $child_plugin_ids: Keys are plugin IDs. Values are arrays with those plugin's child plugin IDs.

Return value

array[] The return value is identical to that of self::hierarchy().

1 call to ListPaymentStatuses::buildHierarchyLevel()
ListPaymentStatuses::buildHierarchy in src/Controller/ListPaymentStatuses.php
Returns a hierarchical representation of payment statuses.

File

src/Controller/ListPaymentStatuses.php, line 152

Class

ListPaymentStatuses
Handles the "list payment methods" route.

Namespace

Drupal\payment\Controller

Code

protected function buildHierarchyLevel(array $parent_plugin_ids, array $child_plugin_ids) {
  $hierarchy = [];
  foreach ($parent_plugin_ids as $plugin_id) {
    $hierarchy[$plugin_id] = isset($child_plugin_ids[$plugin_id]) ? $this
      ->buildHierarchyLevel($child_plugin_ids[$plugin_id], $child_plugin_ids) : [];
  }
  return $hierarchy;
}