Advertisement
fagci

Untitled

Dec 19th, 2019
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. foreach ($db->query($q)->fetchAll(PDO::FETCH_ASSOC) as $item) {
  2.             $global_type = $item['global_type'];
  3.             $object_type = $item['object_type'];
  4.             $group_id = $item['group_id'];
  5.             $group_name = $item['group_name'];
  6.             $type_name = $item['type_name'];
  7.  
  8.             $type_names[$global_type]['items'][$object_type]['id'] = $object_type;
  9.             $type_names[$global_type]['items'][$object_type]['name'] = $type_name;
  10.             $type_names[$global_type]['items'][$object_type]['items'][$group_id]['id'] = $group_id;
  11.             $type_names[$global_type]['items'][$object_type]['items'][$group_id]['name'] = $group_name;
  12.             $type_names[$global_type]['items'][$object_type]['items'][$group_id]['items'][] = [
  13.                 'attr_name' => $item['attr_name'],
  14.                 'label' => $item['label'],
  15.             ];
  16.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement