Function __global->get_catalogue_entries_tree
Definitions
sources/catalogues.php
- Get a list of maps containing all the catalogue entries, and path information, under the specified category - and those beneath it, recursively.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $catalogue_name | ID_TEXT | No | No | required parameter | N/A | N/A | The catalogue name |
| $submitter | ?AUTO_LINK | No | No | Null | N/A | N/A | Only show entries submitted by this member (null: no filter) |
| $category_id | ?AUTO_LINK | No | No | Null | N/A | N/A | The category being at the root of our recursion (null: true root) |
| $breadcrumbs | ?string | No | No | Null | N/A | N/A | The breadcrumbs up to this point in the recursion (null: blank, as we are starting the recursion) |
| $title | ?ID_TEXT | No | No | Null | N/A | N/A | The name of the $category_id we are currently going through (null: look it up). This is here for efficiency reasons, as finding children IDs to recurse to also reveals the child's title |
| $levels | ?integer | No | No | Null | N/A | N/A | The number of recursive levels to search (null: all) |
| $editable_filter | boolean | No | No | False | N/A | N/A | Whether to only show for what may be edited by the current member |
Returns
- A list of maps for all categories. Each map entry containing the fields 'id' (category ID) and 'breadcrumbs' (path to the category, including the categories own title), and more.
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get a list of maps containing all the catalogue entries, and path information, under the specified category - and those beneath it, recursively.
*
* @param ID_TEXT $catalogue_name The catalogue name
* @param ?AUTO_LINK $submitter Only show entries submitted by this member (null: no filter)
* @param ?AUTO_LINK $category_id The category being at the root of our recursion (null: true root)
* @param ?string $breadcrumbs The breadcrumbs up to this point in the recursion (null: blank, as we are starting the recursion)
* @param ?ID_TEXT $title The name of the $category_id we are currently going through (null: look it up). This is here for efficiency reasons, as finding children IDs to recurse to also reveals the child's title
* @param ?integer $levels The number of recursive levels to search (null: all)
* @param boolean $editable_filter Whether to only show for what may be edited by the current member
* @return array A list of maps for all categories. Each map entry containing the fields 'id' (category ID) and 'breadcrumbs' (path to the category, including the categories own title), and more.
*/
function get_catalogue_entries_tree(string $catalogue_name, ?int $submitter = null, ?int $category_id = null, ?string $breadcrumbs = null, ?string $title = null, ?int $levels = null, bool $editable_filter = false) : array
* Get a list of maps containing all the catalogue entries, and path information, under the specified category - and those beneath it, recursively.
*
* @param ID_TEXT $catalogue_name The catalogue name
* @param ?AUTO_LINK $submitter Only show entries submitted by this member (null: no filter)
* @param ?AUTO_LINK $category_id The category being at the root of our recursion (null: true root)
* @param ?string $breadcrumbs The breadcrumbs up to this point in the recursion (null: blank, as we are starting the recursion)
* @param ?ID_TEXT $title The name of the $category_id we are currently going through (null: look it up). This is here for efficiency reasons, as finding children IDs to recurse to also reveals the child's title
* @param ?integer $levels The number of recursive levels to search (null: all)
* @param boolean $editable_filter Whether to only show for what may be edited by the current member
* @return array A list of maps for all categories. Each map entry containing the fields 'id' (category ID) and 'breadcrumbs' (path to the category, including the categories own title), and more.
*/
function get_catalogue_entries_tree(string $catalogue_name, ?int $submitter = null, ?int $category_id = null, ?string $breadcrumbs = null, ?string $title = null, ?int $levels = null, bool $editable_filter = false) : array

