Function __global->cns_organise_into_tree

Definitions

sources/cns_forums.php

  • Organise a list of forum rows into a tree structure.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
&$all_forums array Yes No required parameter N/A N/A The list of all forum rows (be aware that this will get modified for performance reasons)
$forum_id AUTO_LINK No No required parameter N/A N/A The forum row that we are taking as the root of our current recursion

Returns

  • The child list of $forum_id
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Organise a list of forum rows into a tree structure.
 *
 * @param  array $all_forums The list of all forum rows (be aware that this will get modified for performance reasons)
 * @param  AUTO_LINK $forum_id The forum row that we are taking as the root of our current recursion
 * @return array The child list of $forum_id
 */

function cns_organise_into_tree(array &$all_forums, int $forum_id) : array